memory-store
v1.4.4OpenContext memory storage + search SDK with HTTP and MCP server entry points.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
memory.health
Returns the health status of the memory store.
memory.search Search Memory
Cross-source semantic search across raw messages, insights, and uploaded knowledge. Set `synthesize: true` to opt into LLM synthesis over the gathered evidence. With synthesis enabled, the response carries `answer`, `evidence`, `results`, and `warnings`; otherwise just `results`, `evidence`, and `count`.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
userId * | string | |
authToken | string | |
botIds | array | |
documentIds | array | |
includeArchivedInsights | boolean | |
includeRetrievalDiagnostics | boolean | |
limit | integer | |
mergeStrategy | string | |
reasoningStrategy | string | LLM reasoning strategy. `rewrite` rephrases the query before embedding; `iterative` runs a planner that searches, notes evidence, and searches again; `union` merges the planner's evidence with the bas… |
responseSchema | object | |
rrfK | integer | |
rrfWeights | object | |
sessionNeighborExpansion | object | |
sources | array | Default: ['memory','insights','knowledge','workspace'] |
synthesize | Opt-in LLM synthesis. `true` returns `{ answer, evidence, results, warnings }`. `synthesize.responseSchema` extracts `answer` from a JSON payload. | |
threshold | number | Optional similarity floor. Omit it to let the default RRF pipeline fuse the full candidate window. |
tiers | array | Evidence tiers. Default: ['raw','insight','knowledge','workspace']; synthesis additionally includes 'summary'. |
memory.writeRawMessage Write Raw Message
Persist a single raw message to the user's memory store.
| Parameter | Type | Description |
|---|---|---|
message * | object | |
userId * | string | |
embedOnInsert | boolean | When true AND the host wired `unified.embedQuery`, fill in any missing `embedding` server-side via that embedder. Required when the active memory backend is sqlite-vec and the caller doesn't pre-embed… |
memory.getRawMessage Get Raw Message
Fetch a single raw message by its message id.
| Parameter | Type | Description |
|---|---|---|
messageId * | string | |
userId * | string |
memory.consolidate Consolidate
Agentic write-back: gathers evidence like `memory.search({ synthesize: true })`, builds a memory-consolidation plan, optionally asks the LLM to veto unsafe entries, then persists via the attached graph store + soft-deprecates via the storage adapter. Set `dryRun: true` to inspect the plan without writing.
| Parameter | Type | Description |
|---|---|---|
ownerScopeUserId * | string | Required: who owns the writes. |
query * | string | |
userId * | string | |
authToken | string | |
botIds | array | |
dateFrom | string | |
dateTo | string | |
dryRun | boolean | |
expectedVersion | string | |
limit | integer | |
llmPlanReviewMaxTokens | integer | |
threshold | number | |
tiers | array | Default: ['summary','raw','insight','knowledge'] |
memory.distill Distill Entities
Extract `EntityEdge`s from a single raw message via the host's `unified.entityExtractor`. Returns `{ edges, warnings }`. Without the extractor wired in, returns an empty list with a `distill_extractor_not_configured` warning. Persistence is the host's responsibility — the MCP transport cannot carry host-side `persist` callbacks. Call `distillRawMessage` directly from host code if you need round-trip persistence.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
messageId * | string | |
userId * | string |
memory.derive Derive Facts
Synthesize `DerivedFact`s over a window of candidate fact texts via the host's `unified.deriver`. Returns `{ facts, warnings }`. Without the deriver wired in, returns an empty list with a `derive_deriver_not_configured` warning. Persistence is the host's responsibility — the MCP transport cannot carry host-side `persist` callbacks. Call `deriveFacts` directly from host code if you need round-trip persistence.
| Parameter | Type | Description |
|---|---|---|
userId * | string | |
botIds | array | |
candidateLimit | integer | |
candidateTexts | array | Pre-computed candidate fact texts. When omitted, the SDK pulls up to `candidateLimit` (default 50) texts via the lexical sub-query. |
dateFrom | string | |
dateTo | string | |
factTypes | array | Optional FactType filter forwarded to the lexical candidate-fetch fallback. |
peers | array | Optional peer scope forwarded to the lexical candidate-fetch fallback. |
query | string | Optional topical query used to derive lexical keywords when `candidateTexts` is omitted. Loop-engine schedulers should pass the topic they want synthesized facts about (e.g. 'cat preferences'). Withou… |
windowFrom | number | Optional time-window start (ms) forwarded to the deriver. |
windowTo | number | Optional time-window end (ms) forwarded to the deriver. |
memory.vsaStore VSA Store Fact
Persist a (role, filler) binding into the user's VSA memory. The vectors are stored as Float32 BLOBs alongside the labels; later `memory.vsaRecall` rebuilds the memory vector and picks the best vocabulary match.
| Parameter | Type | Description |
|---|---|---|
fillerLabel * | string | |
fillerVector * | array | |
roleLabel * | string | |
roleVector * | array | |
userId * | string | |
botId | string | |
factId | string | |
scopeTag | string |
memory.vsaRecall VSA Recall
Rebuild the user's VSA memory vector from stored (role, filler) facts, unbind by the requested role, and cleanup against the supplied vocabulary. Returns the best-match label plus a sorted score list and warnings (e.g. low confidence, dim mismatch).
| Parameter | Type | Description |
|---|---|---|
roleLabel * | string | |
roleVector * | array | |
userId * | string | |
vocabulary * | array | |
botId | string | |
maxFacts | integer | |
scopeTag | string |
memory.vsaList VSA List Facts
List the (role, filler) facts stored for a user. Vectors are stripped from the response — for the underlying storage layer, query SQLite directly.
| Parameter | Type | Description |
|---|---|---|
userId * | string | |
botId | string | |
includeDeprecated | boolean | |
scopeTag | string |
memory.vsaForget VSA Forget Facts
Soft-delete one or more VSA facts by id. Idempotent — facts already deprecated return `deprecatedCount: 0`.
| Parameter | Type | Description |
|---|---|---|
factIds * | array | |
userId * | string | |
reason | string |
memory.okfImport Import OKF Document
Convert an OKF v0.2 document (YAML front-matter + Markdown body) into a RawMessage and persist it under the given userId. Returns the new messageId and factType on success, or an `issues[]` array on validation failure.
| Parameter | Type | Description |
|---|---|---|
document * | object | |
userId * | string | |
botId | string | |
platform | string |
memory.okfExport Export OKF Documents
Query the user's RawMessage records and return them as OKF v0.2 documents (frontMatter + body). Optional filters: botId, platform, since/until (ISO 8601 or epoch ms), okf types, includeArchived.
| Parameter | Type | Description |
|---|---|---|
userId * | string | |
botId | string | |
includeArchived | boolean | |
platform | string | |
since | string | |
types | array | |
until | string |