Technical stack
The product architecture is implemented as a persistence-first runtime with explicit durable owners, rebuildable retrieval, and request-time context assembly.
This page summarizes the active technical direction behind that model.
Design goals
The clean-slate stack is optimized for:
- persistence-first runtime behavior with explicit durable owners
- fewer package boundaries that map directly to the accepted architecture
- request-time context assembly with a stable prompt envelope
- rebuildable retrieval indexes and summaries
- cutover paths that delete overlap instead of preserving it forever
It explicitly tries to avoid:
- compatibility shims that keep legacy owners alive
- mirrored writes between old and new packages
- hidden prompt-owned state
- a second memory or learning store outside the canonical evidence path
- provider-specific indexing logic leaking into product modules
Core runtime stack
Runtime and contracts
Python 3.12+pyproject.tomlplusuvfor project metadata and dependency managementpydantic v2for configuration models and internal contracts- standard-library logging first, with typed telemetry events
Persistence and retrieval
SQLiteas the primary structured storeSQLAlchemy 2andAlembicfor migrationsSQLite FTS5for lexical retrievalmmbert-embed-32k-2d-matryoshkaas the vector retrieval backbone- optional sidecar indexes only when they remain rebuildable from canonical evidence rows
Recommended mmbert modes:
64dfor broad low-cost candidate generation256dfor default online recall768dfor rebuild, replay, and difficult recovery evaluation
Interfaces and surfaces
Typerfor the CLI command surfaceprompt_toolkitplusRichfor the direct shellFastAPIplusuvicornfor the API server- in-process background scheduling first, external workers only when the learning loop and verification queues prove they are needed
Package topology
The long-term package cut should mirror the architecture more directly. The target shape is:
packages/runtimefor one-turn orchestration and wake executionpackages/stateforProfileGraphandWorkGraphpackages/evidencefor evidence formation, retrieval, and governancepackages/contextforSessionFrameconstruction and prompt assemblypackages/learningfor clustering, verification, and procedure promotionpackages/skillsfor skill packaging and overlayspackages/capabilitiesfor tools, providers, auth, and adapterspackages/operatorfor inspect and patch surfacespackages/storage,packages/session,packages/security,packages/telemetry, andpackages/contractsfor shared infrastructure
Cutover direction
The technical design also defines where older package boundaries should land over time:
packages/profilefolds intopackages/statepackages/planningfolds intopackages/stateorpackages/runtimepackages/memoryfolds intopackages/evidencepackages/experienceis replaced bypackages/learning- prompt-era write helpers should move into
packages/operatoror be deleted when they only exist to compensate for missing runtime-owned persistence
The core rule is simple: when a clean-slate package becomes authoritative, delete the legacy overlap instead of mirroring it forever.
Validation shape
The technical design assumes validation across several layers:
- repository-native unit, integration, end-to-end, and scenario tests
- lint and formatting checks
- static typing
- replay and recovery evaluation for difficult continuity paths
- release and contract validation in CI
One important reality check
The design stack sketches a broader future for operator-facing web surfaces, but the currently shipped public docs site in this repository is still a static Docusaurus app.
That is intentional here:
- this page summarizes the runtime target architecture
- the public site remains a lightweight documentation shell
- future richer operator surfaces should be judged against the same durable-owner model rather than treated as a second source of truth
Where to go next
For a messaging-facing extension of the same runtime, continue with Gateway and messaging adapters.