Skip to main content

Lightweight multi-agent orchestration with prompt-planning workflows

Project description

simagents

simagents is a lightweight Python framework for building multi-agent workflows with:

  • Linear, parallel, and loop orchestration modes
  • Agent-level model configuration
  • Prompt-planning friendly task chaining
  • Safe decision logs (reasoning summaries)
  • Retry/backoff + run artifact persistence

Why simagents (vs broader frameworks)

  • Workflow-first: orchestration mode is a first-class setting (linear, parallel, loop)
  • Prompt-planning native: easy to build research → prompt-plan → execution flows
  • Simple API: define agents + tasks + workflow, then run
  • Production-lite defaults: retries, logs, artifact folders, decision logs

Install (local)

From the simagents/ folder:

pip install -e .

For tests/dev:

pip install -e ".[dev]"

Environment variables

simagents supports multiple provider adapters via the OpenAI SDK-compatible interface:

  • OpenAIProvider
  • OllamaProvider
  • OllamaCloudProvider
  • GroqProvider
  • TogetherProvider
  • OpenRouterProvider
  • AnthropicProvider (Claude)
  • OpenAICompatibleProvider (custom base URL)

Base env vars:

SIMAGENTS_API_KEY=your_key
SIMAGENTS_BASE_URL=https://api.openai.com/v1

Fallback key env var:

  • OPENAI_API_KEY

Provider-specific common keys:

  • OLLAMA_API_KEY, OLLAMA_BASE_URL
  • OLLAMA_CLOUD_API_KEY, OLLAMA_CLOUD_BASE_URL (defaults to https://ollama.com/)
  • GROQ_API_KEY
  • TOGETHER_API_KEY
  • OPENROUTER_API_KEY
  • ANTHROPIC_API_KEY

Claude model examples:

  • claude-4-6-sonnet-latest
  • claude-4-7-opus-latest

Quickstart

from simagents import AgentSpec, EasyOrchestrator, RunConfig, TaskSpec, WorkflowSpec
from simagents.core.models import WorkflowMode
from simagents.llm import AnthropicProvider, OpenAIProvider

agents = [
    AgentSpec(name="researcher", role="Research specialist", model="gpt-4o-mini"),
    AgentSpec(name="writer", role="Technical writer", model="gpt-4o-mini"),
]

tasks = [
    TaskSpec(name="research", agent_name="researcher", prompt_template="Research: {input}"),
    TaskSpec(name="final", agent_name="writer", prompt_template="Write post using: {research}"),
]

workflow = WorkflowSpec(mode=WorkflowMode.LINEAR)
run_config = RunConfig(output_dir="runs", save_artifacts=True)

orch = EasyOrchestrator(
    agents=agents,
    tasks=tasks,
    workflow=workflow,
    run_config=run_config,
    provider=OpenAIProvider(),
)
result = orch.run(input_text="How AI is changing bioinformatics")
print(result.final_output)
print(result.decision_log)

# Claude usage (swap provider)
# orch = EasyOrchestrator(
#     agents=agents,
#     tasks=tasks,
#     workflow=workflow,
#     run_config=run_config,
#     provider=AnthropicProvider(),
# )

Orchestration modes

  • WorkflowMode.LINEAR: run tasks one by one
  • WorkflowMode.PARALLEL: run tasks concurrently
  • WorkflowMode.LOOP: rerun full task chain until stop keyword appears or max iterations reached

In PARALLEL mode, TaskSpec.depends_on is respected as a dependency graph.

Loop controls:

  • WorkflowSpec.max_iterations
  • WorkflowSpec.stop_condition_keyword

Flagship example: research + prompt planning

Run:

python examples/research_prompt_plan.py

This example demonstrates:

  1. Research agent gathers structured topic context
  2. Planner agent turns research into a high-quality prompt blueprint
  3. Writer agent executes using that prompt plan

Output artifacts

When save_artifacts=True, each run creates:

  • runs/run-<timestamp>/decision_log.md
  • runs/run-<timestamp>/final_output.md
  • one markdown file per task name

Lifecycle hooks

You can attach optional hooks for observability/instrumentation:

  • on_step_start(step_name)
  • on_step_end(step_name, output)
  • on_error(step_name, exception)

Testing

pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simagents-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simagents-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file simagents-0.1.1.tar.gz.

File metadata

  • Download URL: simagents-0.1.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for simagents-0.1.1.tar.gz
Algorithm Hash digest
SHA256 acbd3b35e5d518c1383a918a10b1ea758a8df65bcb8afa0d7f5d94fbc1a5a37f
MD5 17c74e6cd3d21e1a750d1a9e04030ff5
BLAKE2b-256 2207529db7549513992b51b197031540f69e661254083982f709bc8b35766f0e

See more details on using hashes here.

File details

Details for the file simagents-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simagents-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for simagents-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f56799e67d1b38f5c4295df2b6f7e00522af505dd5ab54cfc7daa7dd104e8f
MD5 d484f4d10761bd522af5ddf0c7e31851
BLAKE2b-256 c6a06c8364dfd588011de51923bd1d6ecaba418f8a1a6afcad4af46034477d12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page