Skip to main content

Native agent graph runtime with Prism cache, memory, swappable PrismRAG retrieval, and Route Ledger

Project description

ChorusGraph

CI Python 3.11+ License: Apache-2.0 Version

Native agent runtime with semantic cache, swappable retrieval (PrismRAG), auditable memory, and enterprise hardening — one pip install, four plug-in ports.

ChorusGraph is not a LangGraph wrapper. It ships a native BSP graph engine (chorusgraph.core.Graph) with the Prism stack attached by default: semantic cache, L2 retrieval, L3 memory, Route Ledger, checkpoints, and observability. Swap backends (Redis cache, vector RAG, custom tools) without rewriting orchestration.

ChorusGraph = native engine + product stack · LangGraph = optional baseline for A/B comparison only (docs/TERMINOLOGY.md)


Why ChorusGraph

Building production LLM agents usually means gluing six systems: orchestration, semantic cache, vector DB, reranker, checkpointing, and audit logs. ChorusGraph ships them as one runtime with explicit plug-in ports.

Pain ChorusGraph answer
Repeat questions burn tokens Two-stage semantic cache (coarse 64-d recall → full verify)
RAG is another integration project RetrievalBackend plug-in — keyword default, PrismRAG vector opt-in
“Why did the agent say that?” Route Ledger + rule_chain on every hop
Orchestration + ops duct tape Native scheduler, health endpoints, Docker/k8s packaging

ChorusGraph's own code has no LangGraph dependency on the product path. chorusgraph.core.Graph, the scheduler, and all four plug-in ports never import LangGraph. (One core dependency, prismlang, uses LangGraph internally for its own checkpointing utilities — a pip show/dependency-tree scan will find it installed, but ChorusGraph's engine never calls it.) Baselines that compare against LangGraph use the optional [benchmark] extra.


Quick start

pip install chorusgraph
# Optional: vector retrieval (Chroma + PrismRAG plug-in)
pip install "chorusgraph[retrieval]"
from chorusgraph import Graph, START, END, ChorusStack
from chorusgraph.core.node import dict_node_adapter

stack = ChorusStack.defaults(tenant_id="demo")

g = Graph(tenant_id="demo", graph_id="hello")
g.add_node(
    "echo",
    dict_node_adapter(lambda s: {"reply": f"Hello, {s.get('name', 'world')}"}, hop="echo"),
)
g.add_edge(START, "echo")
g.add_edge("echo", END)

out = g.compile(stack=stack).invoke({"name": "ChorusGraph"})
print(out)  # {'reply': 'Hello, ChorusGraph'}

Run the bundled demo:

chorusgraph-demo

Full install guide (extras, PrismRAG walkthrough): docs/INSTALL.md

Even faster: let your AI IDE do it

Paste one of these into Cursor, Claude Code, Windsurf, or Copilot Chat — it installs, wires, and verifies ChorusGraph in your project for you:

  • Fresh install prompt — add ChorusGraph to a new or existing project
  • Migration prompt — move an existing LangGraph app over (automated shim) or CrewAI app over (guided manual translation)

Architecture

┌─────────────────────────────────────────────────────────────┐
│  Your graph — nodes, edges, conditional routing              │
├─────────────────────────────────────────────────────────────┤
│  ChorusStack — four swappable ports                          │
│  ┌──────────┬──────────┬──────────┬──────────────────────┐  │
│  │ Cache    │ Memory   │ Tools    │ Retrieval (L2)       │  │
│  │ Prism /  │ Cortex   │ Registry │ Keyword / PrismRAG   │  │
│  │ Redis    │          │          │                      │  │
│  └──────────┴──────────┴──────────┴──────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  Engine (fixed): BSP scheduler · envelopes · Resonance · JL  │
├─────────────────────────────────────────────────────────────┤
│  Route Ledger · checkpoints · tenant guards · observability  │
└─────────────────────────────────────────────────────────────┘
Layer Default Swap
L1 cache Semantic PrismCache RedisCacheBackend
L2 retrieval Keyword overlap PrismRAGRetrievalBackend
L3 memory PrismCortex Disable or custom
Tools Finance registry MCP / allowlisted registry

Details: docs/COMPOSE.md · docs/PLUGINS.md

PrismRAG retrieval plug-in

from chorusgraph.compose import ChorusStack, PrismRAGRetrievalBackend
from chorusgraph.embedders import PrismlangOnnxEmbedder

backend = PrismRAGRetrievalBackend(
    embedder=PrismlangOnnxEmbedder(),
    mapping={"categories": [...], "rules": [...]},
)
backend.index(your_corpus)

stack = ChorusStack.defaults(tenant_id="acme").with_retrieval(backend)
retrieve_node = stack.to_retrieve_handler(topic="policy", top_k=6)

Prism stack layers

Layer Component Role
L0 — hop PrismLang 64-d state compression + rule_chain audit
L1 — cache PrismCache Semantic gate, Resonance-scored recall
L2 — knowledge Retrieval plug-in Keyword default · vector + taxonomy opt-in
rerank PrismResonance Shared substrate rerank
L3 — memory PrismCortex Structured, replayable memory
transport CHORUS / PrismAPI Cross-node envelopes · federation hooks

Benchmark proof (Azure, canonical run 20260704_212111)

Fair A/B vs competent LangGraph baselines — same model, tools, prompts, workload. See benchmark/FAIRNESS_H9.md.

Scenario LangGraph ChorusGraph Delta
Finance single (FL1→FC1) 87.5% 100% +12.5 pp
Finance multi (FL2→FC2) 75% 87.5% +12.5 pp
Healthcare single (HL1→HC1) 72.5% 72.5% tie
Healthcare multi (HL2→HC2) 57.5% 87.5% +30 pp

Full report: benchmark/results/azure_20260704_212111/.../COMPARISON_REPORT.md

Run scenarios locally (requires GEMINI_API_KEY + [benchmark] extra):

pip install -e ".[benchmark,gemini]"
python -m benchmark.run_scenarios --tier light --scenarios all

Enterprise 1.0

Capability Status
Native engine (no LangGraph on product path)
CI — 327+ tests, no live keys required
Resilience, security, observability
Docker / k8s deploy docs/DEPLOY.md
Frozen public API docs/API_1_0.md
SQLite durable graph (Postgres Phase 2) 🟡

Readiness scorecard: docs/ENTERPRISE_READINESS.md


Documentation

Doc Description
docs/INSTALL.md pip extras, PrismRAG implementation guide
docs/DEVELOPER_GUIDE.md Build agents on native Graph
docs/PLUGINS.md Cache, memory, tools, retrieval ports
docs/WHITEPAPER.md Product thesis + technical depth
docs/BENCHMARK.md Fairness methodology
docs/STABILITY.md 1.0 API stability guarantee
benchmark/SCENARIOS.md FL/FC/HL/HC scenario matrix

Development

git clone https://github.com/insightitsGit/ChorusGraph.git
cd ChorusGraph
pip install -e ".[dev,benchmark,gemini,retrieval]"
pytest                    # deterministic tier — no API keys
pytest -m live            # live Gemini (needs GEMINI_API_KEY)
ruff check tests .github

Optional dependencies

Extra Purpose
retrieval Chroma + PrismRAGRetrievalBackend
gemini Live Gemini examples
cortex PrismCortex L3 memory
benchmark LangGraph baselines (FL/HL) + chromadb
dev pytest, ruff, mypy, coverage

Principles

  • Native first — FC/HC product paths use chorusgraph.core.Graph only
  • Safe cache before fast cache — two-stage verify; no unsafe generative replay
  • Measure, don't assert — publish benchmarks with fairness disclosure
  • Batteries included, batteries swappable — defaults work; ports swap cleanly

License

Apache-2.0 — see LICENSE.


Provenance

Built by Insight IT Solutions. Dogfooded in production agent hubs. Part of the Prism family (PrismLang, PrismCache, PrismCortex, PrismRAG).

Questions / enterprise: open a GitHub issue or see docs/WHITEPAPER.md for commercial framing.

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

chorusgraph-1.0.2.tar.gz (195.0 kB view details)

Uploaded Source

Built Distribution

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

chorusgraph-1.0.2-py3-none-any.whl (185.7 kB view details)

Uploaded Python 3

File details

Details for the file chorusgraph-1.0.2.tar.gz.

File metadata

  • Download URL: chorusgraph-1.0.2.tar.gz
  • Upload date:
  • Size: 195.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for chorusgraph-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7802be36f7ae3b6d9934b47bc1a117f9658d8d53bf7c3a3254a32fd275d3fb49
MD5 93a3a9059eef876b5c9370f895948454
BLAKE2b-256 15154a14517793d3080fee3c11898a9329e5888dd8d9928090179e4dc2282436

See more details on using hashes here.

File details

Details for the file chorusgraph-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: chorusgraph-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 185.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for chorusgraph-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8341fa85dce7cb9d99645d01f8fd0be4d88d3838903a52f726609f6fcbbb0033
MD5 218b775f89d7c2759ee2ac4a393b2ee8
BLAKE2b-256 82e5a61b6953243fed981386426ff660bc126e7ecc624a87638a84353a94b399

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