A local-first AI agent framework with soul, governance, and self-evolution
Project description
OpenSymphony
Let your agents have character, follow rules, and grow.
An open-source AI agent framework with soul, governance, and self-evolution. Designed to run on consumer hardware.
Why OpenSymphony?
Most agent frameworks focus on orchestration โ chaining API calls. OpenSymphony focuses on who your agents are and how they behave:
- ๐ญ Soul โ Define agent personalities as YAML. Not prompts โ persistent behavioral frameworks.
- โ๏ธ Governance โ Voting, precedent, defense. Agents make collective decisions, not chaos.
- ๐ง Self-evolution โ Agents build their own tools at runtime.
Architecture
Request โ Gateway โ [Intent Bridge] โ [Governance] โ Runtime โ Kernel โ Response
โ
Voting / Precedent / Defense
Onion model: every request passes through governance layers before execution.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gateway (HTTP / WebSocket / CLI) โ
โ โโ HumanAdapter โ Intent Bridge (NLโstruct) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Governance โ
โ โโ VotingMechanism โ multi-agent decisions โ
โ โโ PrecedentStore โ reusable past decisions โ
โ โโ DefenseLayer โ risk assessment โ
โ โโ HITLManager โ human-in-the-loop โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Runtime โ
โ โโ AgentPool โ concurrent agent management โ
โ โโ TaskScheduler โ priority queue โ
โ โโ AgentSandbox โ resource limits โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Kernel โ
โ โโ Soul Compiler โ YAML โ behavioral rules โ
โ โโ LLM Router โ cloud + local providers โ
โ โโ Memory (L1/L2/L3) โ three-tier storage โ
โ โโ Tool Workshop โ agents create tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Quick Start
# Install
pip install opensymphony
# Or from source
git clone https://github.com/lawcontinue/opensymphony.git
cd opensymphony
pip install -e ".[dev]"
# Run tests (377 passing)
pytest
# Start the API server
python -m opensymphony.gateway.http
Example: Define a Soul
# souls/my_agent.yaml
id: my_agent
name: MyAgent
archetype: Code Reviewer
thinking_framework: |
You are a code reviewer focused on security and correctness.
Rules:
1. Flag any unvalidated user input
2. Check for race conditions in concurrent code
3. Prefer readability over cleverness
values:
- Security first
- Evidence-based review
- Constructive feedback
Example: Use the API
from opensymphony.agents.soul import Soul
from opensymphony.agents.soul_compiler import compile_soul
from opensymphony.kernel import SymphonyKernel
# Load a soul
soul = Soul.from_yaml("souls/my_agent.yaml")
prompt = compile_soul(soul, output_mode="agent")
# Create kernel with governance
kernel = SymphonyKernel()
kernel.load_souls("souls/")
# Chat with an agent
response = kernel.chat("my_agent", "Review this function for security issues...")
print(response)
Core Concepts
๐ญ Soul System
Agents are defined by YAML soul files with identity, thinking framework, values, and veto conditions. Souls compile into behavioral constraints that persist across conversations.
13 built-in souls: themis, athena, crit, shield, code, novelist, screenwriter, tech_blogger, legal_writer, social_copy, drama_director, reflector, default.
โ๏ธ Governance Layer
| Mechanism | Description |
|---|---|
| Voting | Multi-agent voting with configurable timeout and majority rules |
| Precedent | Past decisions become searchable, reusable precedents |
| Defense | Risk assessment classifies actions (safe/risky/dangerous) |
| HITL | Human-in-the-loop confirmation for high-risk operations |
๐ง Tool Workshop
Agents can create, test, and deploy their own Python tools at runtime โ no human intervention needed.
๐พ Three-Tier Memory
| Tier | Storage | Use Case |
|---|---|---|
| L1 | In-memory | Current conversation context |
| L2 | SQLite | Experience database with search |
| L3 | Cloud API | Long-term persistent memory |
Requirements
- Python 3.11+
- Optional: 16GB+ RAM for local LLM inference
- Optional: NVIDIA GPU for local models
Project Structure
opensymphony/
โโโ agents/ # Agent core + Soul compiler
โโโ apps/ # Application modules (novel pipeline, content factory)
โโโ gateway/ # HTTP + WebSocket + Human adapters
โโโ governance/ # Voting, precedent, defense, HITL
โโโ kernel.py # Core orchestration
โโโ llm/ # LLM router (cloud + local)
โโโ memory/ # Three-tier memory (L1/L2/L3)
โโโ pipeline.py # Declarative pipeline engine
โโโ runtime/ # Agent pool + scheduler + sandbox
โโโ session.py # Session management
โโโ skill_registry.py # Dynamic skill loading
โโโ telemetry.py # Observability
โโโ tools/ # Production tools + workshop
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opensymphony-0.2.0.tar.gz.
File metadata
- Download URL: opensymphony-0.2.0.tar.gz
- Upload date:
- Size: 177.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5e2e22347156d0cbf4fb7354e5cb5f80bbb9db1260bb04c9f96919d8a53dba2
|
|
| MD5 |
ea07bee28283b431b38cca1b27a81003
|
|
| BLAKE2b-256 |
cf9eac75600a1100b90a8a254cb8ddbbb88af6a0e23ffa178e94b851a6287e4c
|
File details
Details for the file opensymphony-0.2.0-py3-none-any.whl.
File metadata
- Download URL: opensymphony-0.2.0-py3-none-any.whl
- Upload date:
- Size: 152.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad2045cde036ef34e2f696182a47d1a0710f5e77bd21f3247b31bb0c5c5c071e
|
|
| MD5 |
76a0676e281727f5cd2fba19704cbae0
|
|
| BLAKE2b-256 |
9cd115f5131494edbb755c038e94dc300e2d357bf9618d8a73ca990a725e5ba0
|