This release is a pre-release and may not be stable for production use.
Algen's provider-neutral runtime for governed AI agents
pip install algen-agent-runtime==0.1.0a21 Copy PIP instructions
Algen Agent Runtime is a typed, provider-neutral Python runtime for building governed AI agents. It provides deterministic execution state, model routing, tool controls, human approvals, retrieval, verification, durable stores, streaming events, and OpenTelemetry instrumentation without binding applications to one model vendor or agent framework.
Runtime is the open-source execution foundation in a three-product lifecycle:
An agent can be built directly with Runtime or visually in Studio. Studio validates and evaluates the same Runtime project, publishes a versioned package to Marketplace, and deploys it with environment-specific credentials. Marketplace consumers import that package into Studio before configuration and deployment. Secrets and live environment values never belong in a marketplace artifact.
Typed workflows can reference staged file IDs rather than embedding bytes. See the artifact lifecycle for upload, checksum, quarantine, retention, and storage boundaries.
Workflows can also call exact, trusted child workflow versions through a WorkflowRegistry; Runtime preserves correlation, lineage, checkpoints, pause/approval propagation, and recovery. See multi-agent workflows and the importable examples/pattern_child_workflow. For governed outbound messages, see email.
python -m pip install algen-agent-runtime # Or for pre-release builds: python -m pip install --pre algen-agent-runtime Optional integrations are installed as extras:
# Storage, cache, auth python -m pip install --pre 'algen-agent-runtime[postgres,redis,auth]' # Model Context Protocol (MCP) client python -m pip install --pre 'algen-agent-runtime[mcp]' # External framework adapters python -m pip install --pre 'algen-agent-runtime[langgraph]' To install a release from its GitHub tag instead of PyPI:
python -m pip install git+https://github.com/AlgenAI/algen-agent-runtime.git@v0.1.0a21 For development from a checkout:
git clone https://github.com/AlgenAI/algen-agent-runtime.git cd algen-agent-runtime python3.12 -m venv .venv source .venv/bin/activate python -m pip install -e '.[dev]' Verify your installation with the CLI:
algen-agent-runtime --help Quickly scaffold a new agent project:
algen-agent-runtime new my-agent --template agent cd my-agent python app.py Five-minute offline quickstart Single agent This example uses the built-in mock provider, so it requires no API key or external service:
import asyncio from algen_agent_runtime.config.settings import AppSettings from algen_agent_runtime.orchestration.container import build_container from algen_agent_runtime.runtime.client import AlgenAgentRuntimeClient from algen_agent_runtime.types.contracts import RunRequest async def main() -> None: settings = AppSettings.model_validate( { "providers": {"mock": {"type": "mock", "default_model": "deterministic"}}, "agents": [ { "name": "hello", "version": "1.0.0", "description": "Offline quickstart agent", "system_instructions": "Answer concisely.", "default_model": { "name": "default", "provider": "mock", "model": "deterministic", }, } ], } ) container = build_container(settings) try: result = await AlgenAgentRuntimeClient(container.runtime).run( RunRequest( agent="hello", input="Hello", tenant_id="quickstart", user_id="local-user", ) ) print(result.output) finally: await container.aclose() asyncio.run(main()) Expected output:
Hello Multi-agent DAG workflow Execute a multi-agent DAG with dynamic map-agent fan-out, evidence joining, and synthesis:
Completed bounded parallel research for: Assess a migration to managed queues For a real local model, follow the Ollama quickstart.
Algen Agent Runtime provides a CLI for project scaffolding and serving runtime endpoints:
# Scaffold a new agent project (templates: agent, approval, workflow) algen-agent-runtime new my-agent algen-agent-runtime new my-approval-agent --template approval algen-agent-runtime new my-workflow-agent --template workflow # Test and run the scaffolded project offline cd my-agent python app.py pytest # List every component the settings register (tools, planners, providers, ...) and its source, # without running any of them; --path adds a directory for plugin imports algen-agent-runtime describe --config agent.yaml --path src --json # Validate the project as Studio will and warn about code Studio cannot run algen-agent-runtime check agent.yaml --path src # ...or for a project that runs its own server, without the Studio-only warnings algen-agent-runtime check agent.yaml --path src --profile standalone Run the HTTP service From a source checkout with Ollama running and llama3.2 installed:
ALGEN_AGENT_RUNTIME_CONFIG=examples/quickstart_local_chat/agent.yaml \ algen-agent-runtime serve Alternatively, invoking algen-agent-runtime without subcommands defaults to serve for backward compatibility.
In a terminal, serve first prints a banner naming the agent, its model, tools, guards and URLs (--no-banner turns it off, --banner prints it to a log too). An application that runs its own server prints the same banner with its own name and rows:
from algen_agent_runtime.banner import print_startup_banner print_startup_banner(settings, title="ms-email-test", details={"mailbox": "fake (in-process Graph)"}) The default bind is 127.0.0.1:8000. Development-header authentication is intentionally limited to loopback unless the insecure-development override is explicitly enabled.
curl --fail-with-body -X POST http://127.0.0.1:8000/v1/runs \ -H 'content-type: application/json' \ -H 'x-tenant-id: demo' \ -H 'x-user-id: user-1' \ -H 'x-scopes: runs:write' \ -d '{"agent":"minimal","input":"Hello"}' Production deployments should use verified JWT authentication, TLS termination, durable stores, explicit CORS rules, secret references, and infrastructure-level resource controls. See the operations guide.
Similar to Swagger UI for OpenAPI specifications, Algen Agent Runtime provides an in-built interactive UI for inspecting, visualizing, and testing agent.yaml specifications and multi-agent workflows.
Access via running server: Start the server with the --ui flag:
ALGEN_AGENT_RUNTIME_CONFIG=agent.yaml algen-agent-runtime serve --ui Then navigate to http://127.0.0.1:8000/agent-ui (or /ui) in your browser to explore the interactive DAG workflow graph, agent configurations, model provider matrices, tools/MCP servers, and test runs via the built-in playground. You can also enable it permanently in agent.yaml:
api: agent_ui_enabled: true Generate standalone static HTML from CLI: Generate a completely self-contained, offline-compatible static HTML documentation file:
algen-agent-runtime ui --config agent.yaml --output agent-ui.html # Or open directly in your browser: algen-agent-runtime ui --config agent.yaml --open Architecture flowchart TD subgraph Interface["Interface Layer"] Client["Application / Studio / REST / SSE"] end subgraph Workflows["Multi-Agent Workflow Orchestration"] WorkflowExec["MultiAgentWorkflowExecutor"] Manifest["WorkflowManifest (DAG)"] Hooks["WorkflowHookRegistry"] WorkflowExec --- Manifest WorkflowExec --- Hooks end subgraph Core["AgentRuntime Execution State Machine"] Runtime["AgentRuntime State Machine"] Policies["Policy Middleware"] Context["Context Builder"] Planner["Planner"] Router["Model Router"] ToolExec["Tool Executor"] Verifier["Verifier Pipeline"] end subgraph Adapters["Infrastructure & Adapters"] Providers["Model Providers (Local / Cloud)"] Tools["Tools & Resource Connectors"] Stores["Run, Memory & Artifact Stores"] Events["Events, Audit & Telemetry"] end Client -->|Execute workflow DAG| WorkflowExec Client -->|Direct agent run| Runtime WorkflowExec -->|agent / map_agent nodes| Runtime WorkflowExec -->|handler hooks| Hooks Runtime --> Policies Runtime --> Context Runtime --> Planner Runtime --> Router --> Providers Runtime --> ToolExec --> Tools Runtime --> Verifier Runtime --> Stores Runtime --> Events The orchestration layer depends on typed contracts rather than provider SDKs. The composition root resolves configured adapters and registries, while applications retain ownership of domain prompts, metrics, tools, policies, and data access.
See the full architecture guide for the state machine, component boundaries, persistence model, and extension points.
Provider and integration dependencies remain optional. See the provider compatibility matrix, MCP guide, and framework adapter guide.
The source and wheel distributions include the examples package so portable workflow hook providers remain importable by Algen Agent Studio. Import an example directory—or its agent.yaml or config/agent.yaml—and Studio preserves the Runtime WorkflowManifest exactly. Credential-free examples use deterministic mock providers; service-backed case studies retain explicit prerequisites. The domain case studies case_study_responsible_hiring and pattern_text_to_sql ship only in the repository and sdist, not the wheel; run them from a checkout.
The workflow examples cover first-class approve/modify/reject checkpoints, human clarification, bounded repair, exact-version parent/child dispatch, dynamic fan-out, parallel branches, joins, framework adapters, evaluation gates, and secret-free links to tools, retrieval, memory, services, storage, and telemetry.
Every example runs from the terminal without API keys or services, except those that need Ollama or pgvector. tests/integration/test_all_examples_run.py runs each one in CI, so a new example must be runnable offline or listed there with the service it needs.
# Multi-agent dynamic fan-out, evidence join, and synthesis python -m examples.pattern_multi_agent_fanout.app "Assess a migration to managed queues" # Deterministic handler and resource tool pattern python -m examples.quickstart_tool.app # The reference tool project: a Toolkit with a read tool and an approval-gated write tool, from a plugin python -m examples.quickstart_agent_tool.app # An approval node: approve, modify or reject a proposal before it is applied python -m examples.quickstart_approval.app --approve-all # Human approval checkpoint (interactive prompt, or automated with --approve-all) python -m examples.pattern_approval_workflow.app --approve-all # Governed research with retrieval and cited synthesis python -m examples.pattern_governed_research.app # A streamed conversation: deltas, a steering message, a tool note, an approval pause and resume python -m examples.quickstart_conversation.app # Typed tools behind a precheck, tool-call guards, a user-keyed cache and a usage meter python -m examples.pattern_guarded_tools.app # A release gate: evaluation cases decide whether a new agent version is promoted python -m examples.pattern_evaluation_gate.app # MCP servers declared in YAML, with operator overrides deciding which tools need approval python -m examples.pattern_mcp_governance.app # Hosted-provider examples: the real provider by default, the mock provider with --offline python -m examples.quickstart_rag.app --offline python -m examples.quickstart_cloud_chat.app --offline python -m examples.pattern_provider_fallback.app --offline python -m examples.pattern_text_to_sql.app --offline All workflow examples support non-interactive execution in automated environments and CI pipelines:
Examples that call a hosted provider (quickstart_rag, quickstart_cloud_chat, pattern_provider_fallback, pattern_text_to_sql, case_study_teaching_assistant) take --offline: the same agent.yaml with the provider swapped for the mock provider and a scripted reply (see examples/offline.py). Without --offline they need the provider's key and say so when it is missing. Traccia export is opt-in in every example (ALGEN_AGENT_RUNTIME__TELEMETRY__TRACCIA__ENABLED=true with the traccia extra).
Two examples walk through production controls offline, with mock models and in-process fakes:
# A write whose outcome is unknown: pause, reconcile by idempotency key, resolve over # /v1/tool-executions, compensate on request, and ToolNotAttemptedError recorded as failed python -m examples.pattern_side_effect_reconciliation.app # The HTTP API behind OIDC with a local JWKS stub: scopes from claims, the approval inbox, # redacted modified parameters, conversation ownership, token revocation and auth.type: caller # (needs the auth extra: pip install 'algen-agent-runtime[auth]'; without it, it says so and exits 0) python -m examples.pattern_secured_api.app See pattern_side_effect_reconciliation and pattern_secured_api.
make install make lint make typecheck make test Before opening a pull request, run the whole suite against throwaway PostgreSQL and Redis containers (scripts/integration-tests.sh, docker or podman), and smoke-test the latest algen-agent-tools release against a wheel built from your branch. Both steps are described in CONTRIBUTING.md.
Repository-scoped skills under .agents/skills help coding agents use the current Runtime contracts instead of inventing parallel abstractions:
Invoke a skill by name when supported by your coding agent, for example:
Use $algen-agent-builder to create a multi-agent support workflow with CRM reads, approval-gated ticket updates, deterministic tests, and a Studio-importable manifest. The complete contributor workflow, architecture rules, DCO requirement, and test expectations are in CONTRIBUTING.md. Project decision-making and maintainership are documented in GOVERNANCE.md and MAINTAINERS.md.
Do not report vulnerabilities in public issues. Use GitHub private vulnerability reporting as described in SECURITY.md. Never include live credentials, private prompts, customer data, or production endpoints in reports or test fixtures.
Licensed under the Apache License 2.0. Third-party components retain their respective licenses. See NOTICE.
All 2 files in this release have provenance metadata.
auth autogen chroma crewai dev documents encryption faiss frameworks langgraph mcp object-storage openai-agents pgvector postgres qdrant redis traccia transformers vector-stores
agent-runtime agents ai-governance llm model-routing rag
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




