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 Graph
Root of all governed truth
02
Spec
Departmental namespace
03
Schema
Schema per domain
04
Assertion
Atomic unit of truth
05
Derived Artifact
Grounded AI output
payments-api
gateway-config
platform-slo
integration-guide
support-agent
release-notes
Graph Aligned

Graph Inspector

payments-api

Payments · Spec

✓ Approved

Persistence

SQLite for local/dev and PostgreSQL for production 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.