Quick Start Guide

Get started with Sematryx in minutes. This guide will walk you through your first optimization problem.

1. Installation

Install Sematryx using pip:

Install Sematryx
pip install sematryx

2. Get Your API Key

For API access, get your API key from the API Keys page. Choose a plan that fits your needs and complete the checkout process.

3. Your First Optimization

Define your objective function and bounds, then let Sematryx find the optimal solution:

Basic optimization example
from sematryx import Sematryx

# Initialize the client
client = Sematryx(api_key="sk-your-api-key")

# Define your objective function
def sphere(x):
    return sum(xi**2 for xi in x)

# Run optimization
result = client.optimize(
    objective="minimize",
    variables=[
        {"name": "x", "bounds": (-5, 5)},
        {"name": "y", "bounds": (-5, 5)},
    ],
    objective_function=sphere,
)

print(f"Solution: {result.solution}")
print(f"Value: {result.value}")

What happened?

  • Sematryx analyzed your problem and selected the best optimization strategy
  • The optimizer evaluated your function to find the optimal solution
  • The result includes the best parameters, objective value, and explanation

4. Configure the Optimization Engine

Sematryx's optimization engine is built on three pillars of intelligence. Configure them to match your needs:

Engine configuration
from sematryx import Sematryx

client = Sematryx(api_key="sk-your-api-key")

# Use optimization modes
result = client.optimize(
    objective="minimize",
    variables=[{"name": "x", "bounds": (-5, 5)}, {"name": "y", "bounds": (-5, 5)}],
    objective_function=sphere,
    mode="balanced"  # speed, balanced, quality
)

# Get explainable results
result = client.optimize(
    objective="minimize",
    variables=[{"name": "x", "bounds": (-5, 5)}, {"name": "y", "bounds": (-5, 5)}],
    objective_function=sphere,
    explanation_level=2  # 0=none, 1=basic, 2=detailed, 3=comprehensive
)

print(result.explanation)

The Three Core Pillars

  • 🤖 Agentic: Multi-agent coordination for strategy selection
  • 📖 Interpretable: Explainable results with configurable detail levels
  • 🧠 Adaptive: Self-improvement through learning from experience

5. Domain-Specific Optimization

Use specialized optimization libraries for specific business domains:

Domain-specific optimization
from sematryx import Sematryx

client = Sematryx(api_key="sk-your-api-key")

# Portfolio optimization
result = client.optimize_portfolio(
    assets=["AAPL", "GOOGL", "MSFT", "AMZN"],
    returns=[0.12, 0.10, 0.08, 0.15],
    covariance=[...],  # 4x4 covariance matrix
    target_return=0.10,
    max_position=0.4,
    explanation_level=2  # Get audit trail
)

print(f"Allocation: {result.solution}")
print(f"Sharpe Ratio: {result.metrics['sharpe_ratio']}")

Available Domains

  • Financial: Portfolio optimization, trading strategies
  • Healthcare: Drug discovery, clinical trials
  • Supply Chain: Vehicle routing, inventory management
  • AI/ML: Hyperparameter tuning, architecture search
  • Marketing: Campaign optimization, budget allocation
  • Conversational: Natural language problem creation with AI agent

6. Key Concepts

Understanding Optimization

  • Objective Function: The function you want to minimize or maximize
  • Bounds: Search space constraints for each variable
  • Strategy Selection: Sematryx automatically chooses the best optimization algorithm
  • Explainability: Get detailed explanations of optimization decisions
  • Learning: Sematryx improves performance on repeated problems

7. Next Steps

Explore Tutorials

Follow step-by-step tutorials to solve real-world optimization problems.

View Tutorials →

API Reference

Detailed documentation for all optimization APIs and intelligence configuration.

API Reference →

Intelligence Configuration

Learn how to configure Sematryx's 3 Core Pillars: Agentic, Interpretable, and Adaptive intelligence.

Configuration Guide →

Domain Libraries

Explore specialized optimization libraries for your industry.

Domain Docs →