Skip to content

Tutorial

Build your first memory

Initialize a memory, write a page, search it, and ask it a question — about ten minutes from cold start.

This tutorial walks you through the three things that make Quaid useful: writing a page, searching for it, and asking a question that requires more than a keyword match. By the end, you’ll understand the page model and have a memory you can keep using.

  • You’ve installed quaid (see Install Quaid).
  • quaid version works in your shell.

This tutorial uses ~/memory.db throughout. Substitute another path if you prefer; the --db flag and QUAID_DB env var both work.

Initialize a memory

Creates a SQLite file at ~/memory.db with the v5 schema, the FTS5 index, the active embedding model registered, and the embedded skills extracted to ~/.quaid/skills/ on first run.

CLI
quaid init ~/memory.db

Write your first page

Every page splits into compiled truth (above the line) and timeline (below it). The top stays current; the bottom is append-only evidence. See the page model for why.

Compiled truth + timeline
cat <<'MD' | quaid put people/alice --db ~/memory.db
---
title: Alice Example
type: person
summary: Founder, RiverAI — offline-first knowledge systems
---

# Alice Example

Founder at RiverAI. Works on offline-first knowledge systems.
Reliable async correspondent; consistently sharp on retrieval design.

---

## Timeline

- 2026-04-14 — Met at a demo day; interested in offline-first knowledge.
- 2026-04-22 — Replied to outreach; warm intro to Bob.
MD

Search what you just wrote

search runs FTS5 keyword retrieval. query runs hybrid retrieval (FTS5 + local vector embeddings) so paraphrases and synonyms are honored. Both work over the page you just wrote.

Keyword + hybrid
quaid search "offline-first" --db ~/memory.db
quaid query "who is interested in offline knowledge?" --db ~/memory.db

Ask a question with context

With —depth auto, the engine expands context up to the active token budget — assembling enough surrounding chunks to feed straight into a downstream LLM. See hybrid search for the mechanics.

Progressive retrieval
quaid query "who would I ask about retrieval design?" --depth auto --db ~/memory.db

Append a timeline entry

Add evidence without rewriting the whole page. timeline-add is idempotent on (slug, date, summary) — re-running the same call is a no-op.

Structured timeline
quaid timeline-add people/alice \
--date 2026-05-03 \
--summary "Co-authored draft on local embeddings; sharp edits." \
--db ~/memory.db

See what you have

You’ll see one page, one timeline entry, and one active embedding model.

Inspect the memory
quaid stats --db ~/memory.db
quaid list --type person --db ~/memory.db

You created a SQLite file, wrote a page that follows the compiled-truth + timeline model, and ran two different retrieval strategies against it. Specifically:

  • init wrote the v5 schema, registered BAAI/bge-small-en-v1.5 (or whichever model you used), and extracted the embedded skills.
  • put parsed the frontmatter, split the body at the --- separator, ran novelty deduplication, and enqueued an embedding job.
  • search hit the FTS5 virtual table; query ran FTS5 and the local vector index in parallel and fused the results with set-union.
  • query --depth auto then ran progressive retrieval, expanding context until it hit the 4000-token default budget.

All of this happened on your machine. Nothing went over the network.

Connect this memory to Claude Code

The memory you just built can be served to any MCP client over stdio. Five lines of config, no keys.