Answers / Get data into your AI
How do I give Claude a persistent memory table?
Recipe verified on
Ran on a private test instance
Short answer
Let Claude create its own table with the create_table tool (names under agent.*) and add to it with append_rows. What it writes is still there in the next conversation, for Claude and for you, and every write is kept as a version.
Steps
- Connect your assistant to your instance (this writes, so it needs your own instance with a ReadWrite key
from the accounts portal; the public demo is read-only). In Claude Code:
claude mcp add --transport http mcpdata https://[you].mcpdata.org/mcp --header "Authorization: Bearer $CDB_API_KEY"
Replace
[you]with your instance's name. Other apps: Connect your AI. - Ask your question. Give your AI this prompt:
Using mcpdata, create a log table agent.notes (topic, note, at) and remember that our fiscal year starts in April. Then show me what's in it.
What your AI does: the tool calls it makes for this prompt, and what came back
create_table(name="agent.notes", kind="log", columns=[{"name": "topic", "type": "string"}, {"name": "note", "type": "string"}, {"name": "at", "type": "datetime"}]) → table agent.notes
append_rows(table="agent.notes", rows=[{"topic": "finance", "note": "Our fiscal year starts on 1 April.", "at": "2026-10-29T09:00:00"}]) → table agent.notes
query(table_name="agent.notes") → 1 row
| topic | note | at |
|---|---|---|
| finance | Our fiscal year starts on 1 April. | 2026-10-29 09:00:00 |
The assistant needs mcpdata connected (step 1) to run the query.
Why this works
A conversation forgets; a table doesn't. A "log" table keeps every row ever appended (findings, decisions, what was done), a "snapshot" table keeps a current list that's replaced as a whole. Both are ordinary tables, so you can query them, chart them, or hand them to another agent.