DocsLearn
Grounded facts
Add a domainto a memory and MemoryLayer can tell your agent when a claim contradicts it — not just that it couldn't find it.
Three verdicts
verify({ text }) → one verdict per claim
grounded
A stored fact confirms it
“Pro costs $19 a month”
refuted
A stored fact contradicts it
“Pro gets 10,000 calls a month”
unsupported
Nothing stored says either way
“Pro includes SSO”
A plain memory can only back a claim up. A grounded one is also turned into subject → relation → object facts that a Z3 solver can reason over, which is what makes refuted possible: a wrong number becomes a visible failure instead of a quiet guess.
What to ground
ground it
Facts that must stay true
- Architecture invariants
- Pricing and plan rules
- Security boundaries and API contracts
- Deliberate decisions — "SQLite, not Postgres"
leave it plain
Anything loose or hedged
- Marketing copy and long prose
- Text that contradicts itself
- Guesses, "usually", "probably"
Solver facts are strict — fuzzy input makes every later check noisy.
Ground a fact
remember({content: "The HNSW index is always reconstructable from the embeddings table.",domain: "architecture",tags: ["arch", "constraint"],priority: 10,namespace: "my-project"})It's stored as a normal memory and promoted to solver facts straight away. For facts you're less sure of, pass promote_immediately: false and let them earn their place through repeat confirmation.
Ground your docs
Pass a domain when you index a folder of Markdown — ADRs, design principles, architecture notes. Only prose is grounded; code bodies never are.
code({action: "ingest",path: "./docs",domain: "architecture",ground_immediately: true,namespace: "my-project"})Check claims
verify splits text into claims and judges each one. Agents are reminded to run it before stating facts; you can call it any time.
verify({text: "The HNSW index persists across restarts. It is rebuilt from the embeddings table.",domain: "architecture"})// claim 1 → refuted// claim 2 → groundedFor one precise relation — "is A a B?", "does A call B?" — prove returns proved, refuted or unknown with a certificate of the facts it used.
prove({ claim: "HNSW index is durable state", domain: "architecture" })// → { verdict: "refuted", certificate: { axioms_used, proof_steps } }Manage domains
domain({ action: "load", source: "./domains/architecture.domain" })domain({ action: "status", name: "architecture" }) // fact count, modedomain({ action: "export", name: "architecture" }) // back to a file, for gitSomething missing or wrong? Email support@memorylayer.in or open an issue.