symfonic-core
Start with Agent and AgentHost. New code builds one agent with
symfonic.Agent and hosts per-tenant agents with symfonic.platform.AgentHost;
see The Simple Agent.
Removed in 11.3.0. From 11.3.0, SymfonicAgent(...) and
AgentBuilder().build() raise EntryPointRemovedError, a migration error,
before anything is built, with no compatibility shim. Do not start new code
on either entry point. symfonic-core==9.12.* is the newest public PyPI line on which both still
construct (private 11.0 to 11.2.6 did too), but it predates the 11.x features, including Agent and
AgentHost, so pinning it does not migrate an 11.x application. Sections below
that use SymfonicAgent or FrameworkConfig describe that compatibility
surface; Guide 22
maps it to Agent capabilities, and Agent does not accept the same
arguments.
Overview
symfonic-core is a Python framework for building agents. A minimal agent
needs a model provider. Applications can add tools, memory, knowledge
retrieval and other capabilities as needed. PostgreSQL supports durable
storage for applications that choose it. See the
Core 11 capability catalog.
symfonic-core ships a set of cooperating subpackages in a single distribution:
| Subpackage |
Role |
symfonic.core |
Graph execution engine: nodes, edges, DI container, tools, streaming |
symfonic.memory |
5-layer HMS: episodic, semantic, procedural, prospective, working |
symfonic.agent |
Orchestration: implements the Agent facade (import it as symfonic.Agent), the SymfonicAgent compatibility entry point, FastAPI bridge |
symfonic.platform |
AgentHost: one agent per scope over shared resources |
symfonic.knowledge |
Semantic knowledge retrieval (RAG) layer |
symfonic.observability |
Cross-cutting metrics, cost tracking, and OpenTelemetry adapters |
symfonic.tools |
Built-in tool integration adapters |
symfonic.infra |
Infrastructure abstractions for external services |
symfonic.diagnostics |
symfonic doctor — adopter-config audit |
symfonic.cli |
Scaffolding CLI (symfonic init) and agent command line |
Quick Start
Installation
pip install symfonic-core
With Anthropic provider and FastAPI support:
pip install "symfonic-core[anthropic,agent-api]"
This installs the 11.x line from public PyPI,
which ships symfonic.Agent and symfonic.platform.AgentHost used by the examples below.
Upgrading from 9.x: 11.x is a breaking release. SymfonicAgent(...) and
AgentBuilder().build() raise EntryPointRemovedError. If your code still uses them,
pin symfonic-core==9.12.*, the newest public PyPI line on which both still construct
(private 11.0 to 11.2.6 did too), and read Moving to 11.0 before upgrading.
Environment Variables
| Variable |
Required |
Description |
ANTHROPIC_API_KEY |
For real LLM |
Anthropic API key |
POSTGRES_DSN |
For persistence |
PostgreSQL connection string |
MONGODB_URI |
Optional |
MongoDB URI for graph visualization secondary |
Minimal Code Example
import asyncio
from symfonic import Agent
from symfonic.core.testing import MockModelProvider
async def main() -> None:
agent = Agent(MockModelProvider(response="Hello!"))
result = await agent.run("What do you know about us?")
print(result.text)
print(f"Tokens: {result.usage.total_tokens}")
asyncio.run(main())
This Agent has no memory, tenant scope or session: it runs one turn with
the provider you pass. Memory and other features are opt-in capabilities; see
Guide 22.
Hosting one agent per tenant
AgentHost owns shared resources and composes one Agent per scope on first
use. The composer is synchronous and must return an Agent; a host refuses a
SymfonicAgent.
import asyncio
from symfonic import Agent
from symfonic.core import TenantScope
from symfonic.core.testing import MockModelProvider
from symfonic.platform import AgentHost
def compose(scope: TenantScope, resources: object) -> Agent:
return Agent(MockModelProvider(response=f"Hello, {scope.tenant_id}!"))
async def main() -> None:
async with AgentHost(composer=compose, resources=None) as host:
agent = await host.agent_for(TenantScope.root("org", "acme"))
result = await agent.run("What do you know about us?")
print(result.text)
asyncio.run(main())
resources=None means there is nothing shared to open or close. A production
host passes its pools there and wires memory, persistence and continuation by
composition; see Guide 22
and Moving to 11.0.
Supported Providers
symfonic-core ships with several model providers. Each is optional -- only install
the package for the provider you need.
| Provider |
Package |
Install Extra |
Thinking |
Streaming |
Limitations |
| Anthropic |
langchain-anthropic |
[anthropic] |
Yes (extended thinking) |
Yes |
Requires API key |
| OpenAI |
langchain-openai |
[openai] |
Partial (o1/o3 only) |
Yes |
No thinking blocks for GPT-4o |
| DeepSeek |
langchain-openai |
[deepseek] |
Yes (R1 reasoning) |
Yes |
Reasoning format differs from Anthropic thinking blocks -- ThinkingDeltaEvent may not capture all reasoning |
| Google Gemini |
langchain-google-genai |
[google] |
Yes (2.5 thinking) |
Yes |
Thinking format not yet standardized in LangChain |
| AWS Bedrock |
langchain-aws |
[aws] |
Yes (Claude 3.7+/4) |
Yes |
Any Bedrock model (Claude, Llama, Nova, Mistral, …) via the Converse API. Wire family auto-detected per model id; non-Claude models are wire-neutral. LLM_MODEL must be a Bedrock model/inference-profile id; region + creds via the boto3 chain. Claude cost telemetry uses Anthropic list rates; other vendors need a pricing override. Native cache_control is not wire-compatible with Bedrock cachePoint |
| OpenRouter |
langchain-openai |
[openrouter] |
Per model |
Yes |
Gateway to many vendors via one OpenAI-compatible endpoint. LLM_MODEL is a fully-qualified id (anthropic/claude-sonnet-4.5); auth via OPENROUTER_API_KEY. Wire-neutral (unknown) family |
| Ollama (local) |
langchain-ollama |
[ollama] |
No |
Yes |
No cloud API -- runs locally. No thinking support. Memory/speed depends on hardware |
| AnthropicOAuth |
(built-in) |
[anthropic] |
Yes |
Yes |
DEV/TEST ONLY — Claude Code OAuth token against a Claude Pro/Max subscription. Auto-loaded from the local store. Not for production (no per-tenant billing, no token refresh). |
| CodexOAuth |
(built-in) |
[openai] |
No |
Yes |
DEV/TEST ONLY — ChatGPT subscription token against the OpenAI Codex backend (OPENAI_CHATGPT_* env vars). Not for production. |
| KimiOAuth |
(built-in) |
[kimi] |
Yes |
Yes |
DEV/TEST ONLY — kimi.com subscription token against the Kimi coding backend (KIMI_OAUTH_* env vars). Not for production. |
Subscription OAuth providers (dev/test only)
AnthropicOAuthProvider, CodexOAuthProvider, and KimiOAuthProvider let a
single developer run the full pipeline (autonomous learning, metacognition)
against a real LLM using the OAuth token their CLI already stored — no metered
API key. They are a local development and testing convenience only: none
bill per tenant or refresh tokens, each replays a personal subscription token
(subscription-auth reuse, which may be throttled or disallowed under the
vendor's ToS), and each refuses to construct in a production-like
environment. For production use the metered providers with a real API key.
See the Subscription OAuth providers guide.
from symfonic import Agent
from symfonic.core.oauth_provider import AnthropicOAuthProvider
agent = Agent(AnthropicOAuthProvider()) # never in production
Provider Usage
from symfonic import Agent
# Anthropic (default)
from symfonic.core.providers import AnthropicProvider
agent = Agent(AnthropicProvider())
# OpenAI
from symfonic.core.providers import OpenAIProvider
agent = Agent(OpenAIProvider())
# DeepSeek
from symfonic.core.providers import DeepSeekProvider
agent = Agent(DeepSeekProvider(api_key="sk-..."))
# Google Gemini
from symfonic.core.providers import GoogleProvider
agent = Agent(GoogleProvider())
# Local Ollama
from symfonic.core.providers import OllamaProvider
agent = Agent(OllamaProvider())
The Pentad -- 5 Memory Layers
| Layer |
Purpose |
Backend |
Persistence |
| Semantic |
Stable knowledge graph -- facts, entities, relationships |
Postgres Graph (+ optional MongoDB secondary) |
Persistent |
| Episodic |
Timestamped interaction history and events |
Postgres Vector |
Persistent |
| Working |
Active reasoning context with 24h TTL thinking nodes |
Postgres Graph (short-TTL) |
Persistent |
| Prospective |
Future plans, reminders, scheduled triggers |
Postgres Graph |
Persistent |
| Procedural |
Learned skills, workflows, tool routing |
Postgres Graph + SkillRegistry |
Persistent |
All five layers share the BaseMemoryStore protocol with a uniform
write / retrieve / delete interface and strict per-tenant isolation via
TenantScope.