Skip to content

For agents

Agent quickstart

One-page primer for an agent connecting to a memory over MCP.

You are an agent connecting to a Quaid via the MCP server. Read this once, then refer to the linked pages for detail. Everything you need to operate is in three places: the tool catalog, the skill workflows, and the sensitivity contract.

A single SQLite file (memory.db) on the user’s machine, exposed over stdio JSON-RPC 2.0 by quaid serve. Twenty-six memory_* tools cover every supported operation. There is no other API; you cannot reach external services through the memory.

The memory holds:

  • Pages with frontmatter, compiled truth, and an append-only timeline.
  • Links between pages with typed relationships and temporal validity.
  • Assertions for contradiction detection.
  • Knowledge gaps logged when retrieval was insufficient.
  • Tags, timeline entries, and optional raw data (API responses).

See Compiled truth + timeline for the page model.

The user has already wired the MCP server. Your runtime spawned quaid serve and exchanged the standard MCP initialize and tools/list handshake. You should see twenty-six memory_* tools registered.

If a tool call fails before any work happens, the most likely reason is a model mismatch (the memory’s model doesn’t match the runtime’s). Surface the error to the user; do not retry.

When connecting to a memory you haven’t seen before:

  1. memory_stats — get page count, link count, gap count, active embedding model. Two calls in: you know the scale.
  2. memory_collections — list attached collections. Decide whether to use a default-collection bare slug or qualify with <collection>::<slug>.
  3. memory_gaps with resolved: false — see what the user is currently stuck on. This often informs the right opening question.

Don’t write before you read. The memory has its own structure; learn it before you contribute.

GoalToolNotes
Look up a specific pagememory_getUse collection-qualified slugs if Ambiguity is returned.
Find pages by keywordmemory_searchFTS5 only. Fast, exact.
Find pages by meaningmemory_queryHybrid (FTS5 + vector). Use this for natural-language questions.
Assemble context for an LLMmemory_query with depth: "auto"Progressive retrieval up to the active token budget.
Listmemory_listFilter by wing, page_type, collection.
Walk relationshipsmemory_graphN-hop BFS; default depth 2.
See inbound linksmemory_backlinksUse to find context for a page.
Read historymemory_timelineAppend-only timeline rows.

Every mutation is gated by the collection write contract. If a collection is restoring or has needs_full_sync = 1, writes return CollectionRestoringError. If a collection is read-only, writes return CollectionReadOnlyError. Don’t retry these blindly.

GoalToolNotes
Create or update a pagememory_putAlways read first; pass expected_version for updates.
Create a typed linkmemory_linkBoth endpoints must exist. Use valid_from/valid_until aggressively.
Close a link intervalmemory_link_closePrefer this over deleting links.
Tag a pagememory_tagsadd and remove are repeatable.
Store raw API outputmemory_rawIdempotent per (slug, source) unless overwrite: true.
Log a knowledge gapmemory_gapHash-only by default — see sensitivity contract.

memory_put accepts expected_version. The right loop is:

fetch → memory_get (note version v)
construct → modify content
write → memory_put expected_version=v
on Conflict:
fetch → memory_get (note new version v')
rebase → reapply your edits on v'
retry → memory_put expected_version=v'

Bare retries with the same expected_version will always fail. Always rebase.

Every memory_gap defaults to sensitivity: internal and stores only the SHA-256 hash of the query. The raw text is not persisted unless explicitly approved. Before escalating a gap to external (e.g. via the enrich skill), you must transition the sensitivity tier with explicit approval.

Read the Sensitivity contract. It’s two screens; non-negotiable.

The user has eight default skills (ingest, query, maintain, enrich, briefing, alerts, research, upgrade) embedded in the binary and overridable per-user (~/.quaid/skills/) or per-project (./skills/); run quaid skills extract to materialize editable copies. When deciding what to do:

  1. If the user has a project SKILL.md in cwd, follow it.
  2. Else, follow ~/.quaid/skills/<skill-name>/SKILL.md.
  3. Else, follow the embedded default.

quaid skills doctor prints the resolution chain and SHA-256 hashes if you need to confirm.