Skip to main content

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.

PyPI License: MIT Tests

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


Download files

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

Source Distribution

opensymphony-0.2.0.tar.gz (177.7 kB view details)

Uploaded Source

Built Distribution

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

opensymphony-0.2.0-py3-none-any.whl (152.6 kB view details)

Uploaded Python 3

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

Hashes for opensymphony-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e5e2e22347156d0cbf4fb7354e5cb5f80bbb9db1260bb04c9f96919d8a53dba2
MD5 ea07bee28283b431b38cca1b27a81003
BLAKE2b-256 cf9eac75600a1100b90a8a254cb8ddbbb88af6a0e23ffa178e94b851a6287e4c

See more details on using hashes here.

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

Hashes for opensymphony-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad2045cde036ef34e2f696182a47d1a0710f5e77bd21f3247b31bb0c5c5c071e
MD5 76a0676e281727f5cd2fba19704cbae0
BLAKE2b-256 9cd115f5131494edbb755c038e94dc300e2d357bf9618d8a73ca990a725e5ba0

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