You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,11 +103,12 @@ As the project grew, we realized that memory alone wasn't enough. Reliability re
103
103
Get up and running in seconds.
104
104
105
105
### 1. Initialize
106
-
Go to your project root and initialize the memory database:
106
+
Go to your project root and bootstrap the memory system (this also downloads `docs/agents/AGENT_CONTRACT*.md` so your proxy/MCP layers have the exact system prompt they inject):
107
107
```bash
108
108
cd /path/to/your/project
109
-
tinymem health
109
+
tinymem init
110
110
```
111
+
If you just want to verify the installation afterward, run `tinymem health`.
111
112
112
113
### 2. Run
113
114
Start the server (choose one mode):
@@ -197,8 +198,8 @@ The tinyMem CLI is your primary way to interact with the system from your termin
197
198
|`run`|**Command Wrapper**| To run a script or tool (like `make` or `npm test`) while "reminding" it of project context. |`tinymem run make build`|
198
199
|`proxy` / `mcp`|**Server Modes**| To start the "brain" that connects tinyMem to your IDE or AI client. |`tinymem mcp`|
199
200
|`doctor`|**Diagnostics**| To fix the system if it stops working or has configuration issues. |`tinymem doctor`|
200
-
|`init`|**Project Bootstrap**| Creates `.tinyMem`, writes the config, and installs the correct agent contracts for your model size. |`tinymem init`|
201
-
|`update`|**Refresh**| Re-runs migrations and downloads whichever agent contract matches your configuration. |`tinymem update`|
201
+
|`init`|**Project Bootstrap**| Creates `.tinyMem`, writes the config, and downloads the AGENT_CONTRACT/AGENT_CONTRACT_SMALL files into `docs/agents` so proxy and MCP modes can inject them without touching your README. |`tinymem init`|
202
+
|`update`|**Refresh**| Re-runs migrations and refreshes the configured agent contract files under `docs/agents` (large or small) to keep proxy/MCP injections in sync. |`tinymem update`|
202
203
203
204
### Writing Memories
204
205
Think of writing memories as "tagging" reality for the AI.
# Your existing scripts now use tinyMem automatically
267
268
```
268
269
270
+
`tinymem init` seeds `docs/agents/AGENT_CONTRACT.md` and `AGENT_CONTRACT_SMALL.md` and the proxy loads the configured file at startup, injecting it as the first system message unless the client already shipped the `**Start of tinyMem Protocol**` marker. This means your SDKs never need to resend the contract; tinyMem enforces it once per request.
271
+
269
272
While proxying, tinyMem now reports recall activity back to the client so that downstream UIs or agents can show “memory checked” indicators:
270
273
***Streaming responses** append an SSE event of type `tinymem.memory_status` once the upstream LLM finishes. The payload includes `recall_count`, `recall_status` (`none`/`injected`/`failed`), and a timestamp.
271
274
***Non-streaming responses** carry the same data via new headers: `X-TinyMem-Recall-Status` and `X-TinyMem-Recall-Count`.
@@ -287,19 +290,23 @@ Compatible with Claude Desktop, Cursor, and other MCP clients.
287
290
```
288
291
289
292
#### Available MCP Tools:
290
-
When tinyMem is running in MCP mode, your AI agent (like Claude or Gemini) gains these "superpowers":
291
-
292
-
***`memory_query`**: **Search the past.** The AI uses this to find facts, decisions, or notes related to its current task.
293
-
***`memory_recent`**: **Get up to speed.** The AI uses this when it first starts to see what has happened recently in the project.
294
-
***`memory_write`**: **Learn something new.** The AI uses this to save a new fact or decision it just discovered or made. *Facts require "Evidence" (like checking if a file exists).*
295
-
***`memory_ralph`**: **Self-Repair.** This is the "Nuclear Option." The AI uses this to try and fix a bug autonomously by running tests, reading errors, and retrying until it works.
296
-
***`memory_stats` & `memory_health`**: **System Check.** The AI uses these to check if its memory is working correctly or how much it has learned.
297
-
***`memory_doctor`**: **Self-Diagnosis.** If the AI feels "confused" or senses memory issues, it can run this to identify problems.
293
+
When tinyMem is running in MCP mode, your AI agent gains a fixed set of tools for recall, enforcement, and diagnostics:
294
+
295
+
***`memory_query`**: Search project memories with lexical recall (PASSIVE). Always run this before writing anything in GUARDED/STRICT modes.
296
+
***`memory_recent`**: Fetch the latest memories to understand the current context before acting.
297
+
***`memory_run_metadata`**: Inspect the enforcement run metadata (execution mode, events, proven counts) to prove the protocol was followed.
298
+
***`memory_claim_success`**: Report whether a claimed success was observed and enforced; adversarial claims without enforcement get flagged.
299
+
***`memory_set_mode`**: Declare PASSIVE, GUARDED, or STRICT before mutations; this is the intent gatekeeper for all memory writes.
300
+
***`memory_check_task_authority`**: Ask tinyMem to read `tinyTasks.md` and confirm which task (if any) has authority so the agent knows what work is authorized.
301
+
***`memory_write`**: Create or update memories with evidence (facts require verified evidence, and recall must happen first in GUARDED/STRICT modes).
302
+
***`memory_stats`** & **`memory_health`**: Surface memory counts, evidence coverage, and database health for monitoring.
303
+
***`memory_doctor`**: Run a self-diagnostic that checks configuration, database connectivity, and enforcement hooks.
304
+
***`memory_eval_stats`**: Retrieve evaluation metrics that measure how well memories, tasks, and enforcement performed during a session.
298
305
299
306
### AI Agent Directives
300
307
**CRITICAL**: If you are building an AI agent, you MUST include the appropriate directive in its system prompt to ensure it uses tinyMem correctly.
301
308
302
-
**Quick Setup:** Run `tinymem init` once to bootstrap `.tinyMem`, create config, and install the correct agent contract for your model size. Use `tinymem update`later to rerun migrations and refresh the contract (it will download the small or large version that your configuration points to).
309
+
**Quick Setup:** Run `tinymem init` once to bootstrap `.tinyMem`, create config, and download the AGENT_CONTRACT/AGENT_CONTRACT_SMALL files that the proxy and MCP layers inject. `tinymem update`reruns migrations and refreshes the same contract files (large or small) without mutating your README.
0 commit comments