Tideline
API, tools, MCP & eval
Reach Tideline four ways: as a library facade, through the agent tools, over MCP, or via the evaluation harness. The engine is structured to be lifted out as a standalone brigade-tideline package — nothing in the facade imports Brigade-specific code.
Library API#
Open a workspace and you get a small, stable facade:
import { Tideline } from "brigade-tideline"; const memory = Tideline.open("/path/to/workspace"); memory.add({ content: "I keep a strict vegetarian diet.", segment: "preference" }); const hits = memory.recall("dietary restrictions"); // hybrid BM25 + vectorconst block = memory.context("dietary restrictions", { maxChars: 800 });memory.feedback(hits[0].memoryId, "up"); // +0.05, reinforce| Method | What it does |
|---|---|
open / over | Open a workspace, or wrap an existing storage backend |
add / remember | Write a fact (through the write-gate + dedup) |
recall | Hybrid recall (preferred); search is pure-lexical |
context | A budgeted, origin-scoped block for a prompt |
explain | Passive recall with a per-hit score breakdown |
feedback | Asymmetric up/down on a fact |
inspect / export / list | Graph neighbourhood, full dump, filtered list |
purge | Reversible soft-delete (lifecycle → pruned) |
The facade takes injectable adapters for the clock, a recall-time threat-scan, an embedder, and an LLM. The embedder and LLM adapters are reserved seams — v1 recall is served by the bundled HRR vector lane (see Recall & ranking).
Agent tools#
Inside a turn, the crew reaches memory through four origin-scoped tools:
recall_memory— meaning-based recall for the current origin.read_memory— read the markdown vault (MEMORY.md/ daily notes).write_memory— write a fact (segment, importance, subjectKey, supersedes).manage_memory— owner-only maintenance:inspect,export,vault,purge,retention,relink, plus the gateddream,retract,restore, andproposeactions.
Each call threads the caller's origin: owners write/recall owner memory; a channel peer is scoped to their own session and can never reach yours.
MCP server#
Expose an agent's memory to any MCP client (an editor, a desktop assistant) over stdio, bound to one principal:
$ brigade mcp # serves the `main` agent's memory$ brigade mcp --agent support # a specific agentIt surfaces memory_add, memory_search, and memory_context. Results are sanitized — control/bidi characters stripped, </> escaped, threats replaced with [BLOCKED], wrapped as untrusted data — and writes from a non-owner principal are stamped retrieved_document so the write-gate and trust weighting apply.
Evaluation harness#
Recall quality is measured, not asserted. The harness runs a capability over deterministic gold sets and reports ranking metrics plus latency percentiles:
- recall@k, MRR, nDCG@k, and hit-rate, with bootstrap confidence intervals.
- Gold sets seed facts, apply supersessions, and resolve cases to memoryIds before scoring.
$ npm run bench # comparison, gold-hard, fs↔convex parity, and ASR edge-case suitesConfiguration#
| Setting | Effect |
|---|---|
BRIGADE_MEMORY_EMBEDDER | Vector lane: model-free (default HRR), openai-256, or a local model |
BRIGADE_MEMORY_LLM_TIMEOUT_MS | Timeout for the extraction/consolidation LLM call (default 60000) |
BRIGADE_DISABLE_MEMORY_EXTRACT | Kill-switch — freezes extraction, consolidation, and decay |
BRIGADE_MAINTENANCE_INTERVAL_MS | Cadence of the nightly maintenance cron (default 24h) |
extensions.slots.memory | Pin a plugin memory backend in brigade.json |
Pluggable backend
FactStore (JSONL) plus a markdown vault. Any module implementing the MemoryCapability contract — registered via b.memory(...) — can replace it; a DB-backed store is the roadmap target. See Extending Brigade.