Memory
In short
- Repo memory adds a map of your code to a call with one header.
- Saved memories are facts your agent keeps and can forget.
- Both can be deleted.
Memory is Petrova's third product, after tools and cheaper inference.
Petrova is not live. Memory works against test fixtures. The summariser that reads your files is a stub; the live one refuses to start. What memory stores, and how to delete it, is on what Petrova keeps.
Petrova has two kinds of memory. Both are opt-in, and both can be deleted.
Repo memory: a map of your code in every call
- Index a commit:
PETROVA_API_KEY=ptrv_test_... npm run petrova -- index . --name my-repoOnly files Petrova has not seen before are sent and charged. Each new file is summarised, and the result is frozen for that commit. An indexed commit is never charged twice. The index is paid from your balance through the usual quote, hold and settle.
- Ask for it in a call by adding one header:
x-petrova-repo: my-repo@<40-character commit sha>Petrova adds that commit's map (at most 1,500 tokens: 1,200 for the repo map, 300 for pinned memories) as one system block. Nothing else in your request changes. The added tokens are billed as normal input. The answer carries
x-petrova-memory-tokenswith the number added.
Limits: 50,000 files per commit, 256 KiB per file. Erase a repo with DELETE /v1/repos/{repo}: its commits, summaries, file list and memories are deleted.
Saved memories: facts your agent keeps
| What | Route | MCP tool |
|---|---|---|
| Save one (1 to 1,000 characters) | POST /v1/memories { "text", "kind", "repo", "pinned", "scope" } | remember |
| Search | GET /v1/memories?q=&repo=&pinned=&limit= (at most 10 come back from recall) | recall, list |
| Delete one | DELETE /v1/memories/{id} | forget |
| Export all as text | GET /v1/memories/export | export |
kindisfact,decisionorconvention.pinnedmemories are added to the repo block.scopeisaccount(every key of the account) orproject(keys of this project only).- "Forget" deletes the row, its text and its search index.
Scopes
Reading memory needs memory:read; saving or deleting needs memory:write.
Gap: npm run sandbox:key can only add quote:write and budget:write today, so no local command makes a key with the memory scopes. Until that is fixed, repo indexing and the MCP memory tools answer 403 scope_denied for a key made with the documented commands. See status.
Tests: tests/integration/memory.test.ts, "index a commit: billed through quote -> hold -> settle, block frozen, status and context readable"; tests/integration/worker.test.ts; tests/integration/privacy.test.ts (forget and repo erase leave no text behind).
Last checked against the code: 16 November 2026. Something wrong? The source of this page is in the repository, so a fix is one edit.