Every AI tool keeps its own private, session-scoped memory. Switch tools, start a new session, or hand work to another agent, and that context is lost â rebuilt by hand every time. SGM is the shared contract that fixes it: a small, transport-independent protocol any conforming implementation can use to exchange memory with any other, regardless of language, storage backend, or host tool.
SGM is organized into four strictly-separated layers â specification â schemas â conformance â reference implementation. The specification is authoritative; the reference implementation is executable documentation only. A third party can implement SGM from the public spec alone, without reading any implementation’s source. That independence is enforced by an explicit test: imagine the reference implementation does not exist â does the repo still make sense?
The interoperability contract, not implementation technology. SGM defines memory records, retrieval, context assembly, provenance (who/what/when/where on every record), scope isolation, annotations (decisions, rules, status, tasks), cross-tool handoffs, capability discovery, and version negotiation.
It deliberately does not mandate a storage engine, language, embedding model, vector database, LLM, or transport. MCP and HTTP are supported bindings, never the protocol.
Two principles run through the whole design. First, provenance is core, not optional â AI memory is easy to misuse, so every record carries who/what/when/where so an agent can tell a fact from a decision from a stale status. Second, don’t over-standardize: for every feature, ask would two independent implementations need to agree on this to interoperate? If not, it stays in the implementation. SGM defines the smallest strong standard capable of meaningful interoperability.
Maintained publicly at github.com/Thairux/sgm under AGPL-3.0. The full protocol, schemas, and conformance suite are browsable at thairux.github.io/sgm.