How can an agent remember things between sessions?
On one machine, a file in the project is the simplest way, and free: JSON or Markdown, or SQLite. Commit it to git when another machine needs it.
Your coding agent may already keep notes: Claude Code loads CLAUDE.md and keeps an auto memory on the machine; Codex and Cursor read AGENTS.md.
Across machines without a repository, use hosted storage: several databases have free plans with an account, and some give an agent a database with no signup that is deleted after a few days unless claimed. AgentMart's Memory locker keeps up to 10 MB for $1 per 30 days.
Free ways
Checked on 2026-10-14. Facts about other services come from their own pages; the sources are under each one.
A file or SQLite in the project
A state.json, NOTES.md or SQLite file the agent reads at the start and writes at the end.
- Free: Free. SQLite is in the public domain.
- Account and card: Nothing.
- Without a server: Yes.
- Keeps: As long as the disk keeps it. On other machines only if you commit it or copy it.
- Mind: SQLite's own docs warn against one database file used at the same time from many computers over a network.
- Sources (read 2026-10-14): https://www.sqlite.org/whentouse.html, https://www.sqlite.org/copyright.html
Your coding agent's own memory files
Claude Code: CLAUDE.md, which you write, and auto memory, which it writes itself; the first 200 lines or 25 KB of its MEMORY.md load in each session. Codex: AGENTS.md files, together up to 32 KiB by default; its local memories are off by default. Cursor: rules files and AGENTS.md.
- Free: Part of those tools.
- Account and card: Nothing more.
- Without a server: Yes.
- Keeps: Claude Code's auto memory and Codex's memories stay on the machine. Files you commit travel with the repository.
- Mind: These are context for the agent, not storage for data: Claude Code's docs say it treats them as context, not as enforced configuration.
- Sources (read 2026-10-14): https://code.claude.com/docs/en/memory, https://learn.chatgpt.com/docs/agent-configuration/agents-md, https://learn.chatgpt.com/docs/customization/memories.md, https://cursor.com/docs/rules
A private GitHub repository
Keep the state file in a private repository; the agent pulls at the start and pushes at the end.
- Free: GitHub Free includes unlimited private repositories.
- Account and card: A GitHub account.
- Without a server: Yes.
- Keeps: Until you delete it. Works across machines.
- Mind: Secret gists are not private. Two machines writing at once cause merge conflicts.
- Sources (read 2026-10-14): https://github.com/pricing, https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists
The MCP reference memory server
A small knowledge graph exposed as MCP tools, kept in a JSONL file on the machine.
- Free: Free and open source.
- Account and card: Nothing.
- Without a server: Yes: your MCP client starts it as a local process.
- Keeps: In a JSONL file on that machine; by default the file sits in the server's own folder, and MEMORY_FILE_PATH chooses another.
- Mind: Its own description: a basic implementation of persistent memory.
- Sources (read 2026-10-14): https://github.com/modelcontextprotocol/servers/tree/main/src/memory
Hosted databases with free plans
Storage you reach from any machine: Cloudflare Workers KV, Neon (Postgres) or Upstash Redis. Upstash and Neon also give an agent a database with no signup: Upstash deletes it after 3 days unless claimed, and anyone with its ID can claim, view or edit its data; Neon's expires after 72 hours unless claimed and is capped at 100 MB of storage and 1 GB of transfer.
- Free: Cloudflare Workers KV: 1,000 writes a day, 1 GB. Neon: 100 projects of 1 GB each. Upstash Redis: 500,000 commands a month on its pricing page (its FAQ says 10,000 requests a day).
- Account and card: An account for the free plans; Neon says no credit card is required. None for the short no-signup databases.
- Without a server: Yes.
- Keeps: Upstash archives a free database after at least 30 days without use. KV changes can take 60 seconds or more to show everywhere.
- Mind: More setup than a file: a client library or REST calls, and a key to keep secret.
- Sources (read 2026-10-14): https://developers.cloudflare.com/kv/platform/pricing/, https://developers.cloudflare.com/kv/concepts/how-kv-works/, https://neon.com/pricing, https://neon.com/docs/reference/claimable-postgres, https://upstash.com/pricing/redis, https://upstash.com/docs/redis/help/faq, https://upstash.com/blog/redis-database-for-agents
Side by side
| Way | Free, and its limits | Account and card | Without a server | How long, and who can read it |
|---|---|---|---|---|
| A file or SQLite in the project | Free. SQLite is in the public domain. | Nothing. | Yes. | As long as the disk keeps it. On other machines only if you commit it or copy it. |
| Your coding agent's own memory files | Part of those tools. | Nothing more. | Yes. | Claude Code's auto memory and Codex's memories stay on the machine. Files you commit travel with the repository. |
| A private GitHub repository | GitHub Free includes unlimited private repositories. | A GitHub account. | Yes. | Until you delete it. Works across machines. |
| The MCP reference memory server | Free and open source. | Nothing. | Yes: your MCP client starts it as a local process. | In a JSONL file on that machine; by default the file sits in the server's own folder, and MEMORY_FILE_PATH chooses another. |
| Hosted databases with free plans | Cloudflare Workers KV: 1,000 writes a day, 1 GB. Neon: 100 projects of 1 GB each. Upstash Redis: 500,000 commands a month on its pricing page (its FAQ says 10,000 requests a day). | An account for the free plans; Neon says no credit card is required. None for the short no-signup databases. | Yes. | Upstash archives a free database after at least 30 days without use. KV changes can take 60 seconds or more to show everywhere. |
| AgentMart Memory locker | Not free: $1 per 30 days. | No sign-up form: your human's account is made by their first top-up, by card (at least $5), or by the free start. | Yes. | While the plan runs (30 days a purchase, renewable). After a plan ends, only you can still read, export and delete what it stored, until our cleanup deletes it 30 days after the end. Only passports of the paying owner can use the instance. |
When AgentMart fits
Memory locker: Private key-value storage that survives between runs: up to 1 MB per value, 10 MB in total. $1 per 30 days.
Your human pays first, with a top-up of at least $5 by card, unless a new account uses the free start (its rules: https://agentmart.ciphyr.ai/llms/free-start.md). Unused balance expires 12 months after your last top-up or purchase. Any top-up or purchase starts the 12 months again. Our guarantee and your human's legal rights are in the terms.
- Up to 10 MB in total, 1 MB per value, 10,000 keys of up to 200 characters.
- Text or bytes, with an etag so that two runs do not overwrite each other without notice.
- Who can read it: Only passports of the paying owner can use the instance.
Ask your human before you buy: it spends their balance. Over MCP (https://agentmart.ciphyr.ai/mcp):
buy {"item": "memory-locker"}
locker_put {"instance_id": "<instance_id from the answer>", "key": "notes", "value": "What I did today"}
# In the next session:
locker_get {"instance_id": "<instance_id>", "key": "notes"}Over HTTP, with a session token your signing code made (the manual's Auth page: https://agentmart.ciphyr.ai/llms/auth.md):
curl -X POST https://agentmart.ciphyr.ai/v1/orders \
-H "Authorization: Bearer $AGENTMART_SESSION" -H "Content-Type: application/json" \
-d '{"item": "memory-locker", "idempotency_key": "my-locker-1"}'
curl -X PUT https://agentmart.ciphyr.ai/v1/utilities/<instance_id>/items/notes -H "Authorization: Bearer $AGENTMART_SESSION" -H "Content-Type: text/plain" --data-binary "What I did today"
curl https://agentmart.ciphyr.ai/v1/utilities/<instance_id>/items/notes -H "Authorization: Bearer $AGENTMART_SESSION"When not to use AgentMart
- Everything runs on one machine: a file in the project is free and simpler.
- You need more than 10 MB, or values over 1 MB.
- You need queries over the data: use a database.
- Your human does not want to keep a prepaid balance.