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.1.tar.gz (177.6 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.1-py3-none-any.whl (152.6 kB view details)

Uploaded Python 3

File details

Details for the file opensymphony-0.2.1.tar.gz.

File metadata

  • Download URL: opensymphony-0.2.1.tar.gz
  • Upload date:
  • Size: 177.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opensymphony-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5e356dcf4e15c6151c669f09cb28e5c4feac65dae0bcc0a9f149a65b6507e150
MD5 c4c94f14b56e0e8e7722fd609c74ce4c
BLAKE2b-256 4eaf7b9041b0e2d9d3db7108261e9c6003f482f839ddb0273e6ff008f42f1b3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensymphony-0.2.1.tar.gz:

Publisher: publish.yml on lawcontinue/opensymphony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opensymphony-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: opensymphony-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 152.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opensymphony-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce23c658508aedd5d86f0f08cb3b9f71f0d762f019c17ed12723bbf419b0a908
MD5 318487687fd795d690f551cf2155ab12
BLAKE2b-256 e7ccca0164363f0dfffe054172438655071585591268eef81343cb3cac26df2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensymphony-0.2.1-py3-none-any.whl:

Publisher: publish.yml on lawcontinue/opensymphony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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