MsgStack
System Architecture

A Five-Layer Stack for Governed Intelligence.

MsgStack isn't just a database; it's a governance protocol. Every piece of information flows through five distinct layers before an AI agent can retrieve it as a grounded fact.

The Architecture Stack

The five governance layers on the left define how truth is structured. The knowledge graph on the right shows how those layers connect and propagate across your organization in practice.

01
The Canon
Root of all governed truth
02
Canon Domain
Departmental namespace
03
Grounding Type
Schema per domain
04
Canon Entry
Atomic unit of truth
05
Derived Artifact
Grounded AI output
Product Spec Domain
GTM Messaging
Legal Compliance
Sales Battlecard
Support Chatbot
Outbound SDR Bot
Canon Aligned

Graph Inspector

Product Spec Domain

Product Team · Canon Domain

✓ Approved

Persistence

SQLite for local/dev and PostgreSQL for hosted environments. Entry data is stored alongside local vector embeddings generated on-device.

Retrieval Fusion

A custom Python engine combines graph adjacency results with vector similarity scores, filtered by user-defined governance states.

MCP Interface

The server implements the Model Context Protocol, exposing tools via JSON-RPC. Compatible with Claude Desktop, Cursor, and ChatGPT.

Governance

Every entry has a lifecycle (DRAFT → APPROVED → LOCKED). Grounding is restricted to approved nodes to prevent unverified drift.

Build on the Canonical Layer.

Ready to dive into the code? Check out the GitHub repository for detailed implementation notes and contribution guides.