memharness
v0.1.2Bi-temporal, provenance-carrying long-term memory for AI agents, in one SQLite file.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
remember
Store ONE atomic fact in long-term memory: a single assertion, ideally one sentence (aim for under 250 characters; writes over 1500 are rejected). Split compound knowledge into multiple remember calls so each piece can be revised independently later. Use for durable knowledge about the user, their projects, preferences, decisions, and environment — not transient task state. If this contradicts an existing belief, find it with recall and use revise instead. Always fill source_ref with where this came from (session, file, URL) if known. If the fact describes code you just read at a known commi…
| Parameter | Type | Description |
|---|---|---|
fact * | string | The atomic statement itself |
subject * | string | What the fact is about, e.g. 'user' or 'project:memharness' |
basis | string | How you know this: user-stated (they told you), verified (you checked directly), reported (read in docs/code but not confirmed), inferred (your deduction). Sets confidence. Default user-stated |
confidence | number | Numeric override for basis; rarely needed |
importance | integer | 1–10 salience: how strongly this should rank up and resist decay. Default 5 (neutral). Reserve 8–10 for durable, high-stakes facts (core identity, hard constraints); 1–3 for incidental detail. |
kind | string | semantic = stable facts/preferences (slow decay), episodic = events/one-offs (fast decay), procedural = how-to/workflow (slow decay). Default semantic. |
predicate | string | Optional relation type, e.g. 'prefers', 'works-on' |
source_agent | string | Which agent/app is writing this |
source_commit | string | Git SHA you read this code at; pins the fact for staleness checking. Omit for non-code facts. |
source_path | string | Repo-relative file path this fact describes, if any. |
source_ref | string | Where this came from: session id, file path, URL, utterance |
valid_from | string | ISO 8601: when this became true in the world, if not now |
recall
Retrieve relevant memories. A plain call returns current beliefs ranked by relevance × confidence × importance × recency (recency is freshened each time a fact is recalled). as_of (ISO date, e.g. '2026-06-01') returns what was believed AT THAT TIME — including facts since revised or retracted. Use as_of to answer 'what did you think before I corrected you?'. subject filters to one entity; kind filters to semantic/episodic/procedural.
| Parameter | Type | Description |
|---|---|---|
as_of | string | ISO date/datetime: return beliefs as held at that instant |
kind | string | Filter to one memory kind |
limit | integer | Max facts, default 8 |
max_tokens | integer | Token budget for the returned facts |
query | string | Free-text search over the facts |
subject | string | Exact subject filter, e.g. 'user' |
revise
Replace a belief with an updated one. The old fact is closed and linked to its successor — history is preserved, never deleted. Use when the user corrects you or circumstances change. Find the old fact's id with recall first. valid_from can backdate when the new state actually began (e.g. 'moved last month'). importance and kind are inherited from the old fact unless you override them.
| Parameter | Type | Description |
|---|---|---|
new_fact * | string | The corrected statement |
old_fact_id * | integer | Id of the fact being superseded |
basis | string | How you know the correction. Sets confidence. Default user-stated |
confidence | number | Numeric override for basis |
importance | integer | 1–10 salience override; default inherits the old fact's importance |
kind | string | Override the memory kind; default inherits the old fact's kind |
source_agent | string | |
source_commit | string | Git SHA you re-read this code at; re-pins the corrected fact. Not inherited from the old fact — supply it if the correction came from code. |
source_path | string | Repo-relative file path the corrected fact describes, if any. |
source_ref | string | |
valid_from | string | ISO 8601: when the new state became true, if not now |
diff
What changed in memory since a given ISO date: new facts learned, beliefs revised, facts retracted. The 'what have you learned about X since Monday?' query.
| Parameter | Type | Description |
|---|---|---|
since * | string | ISO date/datetime to diff from |
subject | string | Limit to one subject |
why
Full provenance and revision chain for a fact: where it came from, when it was learned, what it superseded, and what superseded it. Use to answer 'why do you believe that?' or to audit a belief before revising it.
| Parameter | Type | Description |
|---|---|---|
fact_id * | integer | The fact to explain |
forget
Retract a fact by id, or retract EVERYTHING from a given source_ref (provenance-based deletion: 'forget everything from that session'). Tombstoned, not erased: as_of queries before the retraction still show history; current recall never returns it.
| Parameter | Type | Description |
|---|---|---|
fact_id | integer | Retract this fact |
source_ref | string | Retract every fact recorded from this source |
stats
Memory database statistics: counts, top subjects, schema version, db path.