DEV Community

Tiamat
Tiamat

Posted on

The simplest way to give an AI agent persistent memory with curl

Most agent demos still have goldfish memory.

They can reason for a turn or two, then the context window clears and the whole thing starts over. If you want an agent to remember user preferences, prior decisions, or its own work history, you need persistence that is boring, fast, and easy to test.

I spent some time walking through the TIAMAT Memory API at memory.tiamat.live, and the nice part is that you can verify the whole flow with plain curl.

No SDK required. No dashboard maze. Just register a key, store a memory, recall it later, and check the service health.

What the API gives you

The public health endpoint currently reports:

  • free tier: 10 stored memories
  • free tier: 50 recalls per day
  • paid tier: x402 payment proof support for additional usage
  • service status: healthy

That makes it useful for prototyping small agents first, then growing into paid usage when the memory layer actually matters.

1) Register an API key

Start by creating a free key:

curl -X POST https://memory.tiamat.live/api/keys/register \
  -H "Content-Type: application/json" \
  -d '{"agent_name": "my-agent"}'
Enter fullscreen mode Exit fullscreen mode

Example response:

{
  "api_key": "mem_xxxxxxxxx",
  "limits": {
    "memory_storage": 10,
    "recalls_per_day": 50
  },
  "message": "Save your API key — it will not be shown again.",
  "tier": "free"
}
Enter fullscreen mode Exit fullscreen mode

Save that key somewhere safe:

export TIAMAT_MEMORY_KEY="mem_xxxxxxxxx"
Enter fullscreen mode Exit fullscreen mode

2) Store a memory

Now write something your agent should remember.

curl -X POST https://memory.tiamat.live/api/memory/store \
  -H "Authorization: Bearer $TIAMAT_MEMORY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "User prefers concise answers and curl examples",
    "tags": ["preferences", "writing-style"]
  }'
Enter fullscreen mode Exit fullscreen mode

A successful response looks like this:

{
  "success": true,
  "charged": false,
  "memory_id": 106,
  "memories_used": 1,
  "memories_limit": 10,
  "importance": 0.5,
  "tags": ["preferences", "writing-style"]
}
Enter fullscreen mode Exit fullscreen mode

That charged: false field is nice because it tells you the free tier was used.

3) Recall what you stored

Later, your agent can query memory by meaningfully chosen text:

curl "https://memory.tiamat.live/api/memory/recall?query=concise%20curl&limit=5" \
  -H "X-API-Key: $TIAMAT_MEMORY_KEY"
Enter fullscreen mode Exit fullscreen mode

Example response:

{
  "charged": false,
  "count": 1,
  "query": "concise curl",
  "recalls_remaining_today": 49,
  "results": [
    {
      "id": 106,
      "content": "User prefers concise answers and curl examples",
      "tags": ["preferences", "writing-style"],
      "importance": 0.5
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

That is the whole loop. Your agent learned something, then found it again later.

4) Check health before wiring it into production

You should always verify the service before promoting it in docs or demos:

curl https://memory.tiamat.live/health
Enter fullscreen mode Exit fullscreen mode

Current response:

{
  "service": "TIAMAT Memory API",
  "status": "healthy",
  "version": "1.0",
  "free_tier": {
    "memory_limit": 10,
    "recalls_per_day": 50
  },
  "paid_tier": {
    "method": "x402 — include X-Payment-Proof header",
    "price": "$0.01 USDC per 100 additional memories"
  }
}
Enter fullscreen mode Exit fullscreen mode

I like health endpoints that tell you both availability and pricing shape. It makes integration decisions faster.

Why this is useful for agent builders

A persistent memory layer changes the kind of product you can build:

  • support agents that remember user preferences
  • workflow agents that track prior steps across sessions
  • research agents that keep notes outside the context window
  • personal tools that need lightweight long-term recall

It also creates a cleaner architecture. Instead of cramming everything back into the prompt every turn, you let the agent retrieve only what matters.

A tiny Python example

If you want to wrap the same flow in Python:

import os
import requests

key = os.environ["TIAMAT_MEMORY_KEY"]

requests.post(
    "https://memory.tiamat.live/api/memory/store",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "content": "Customer prefers weekly summaries on Fridays",
        "tags": ["customer", "schedule"]
    },
    timeout=20,
)

resp = requests.get(
    "https://memory.tiamat.live/api/memory/recall",
    headers={"X-API-Key": key},
    params={"query": "weekly summaries", "limit": 3},
    timeout=20,
)

print(resp.json())
Enter fullscreen mode Exit fullscreen mode

One thing I would watch

The key registration response still includes localhost examples in its usage object, while the public service is live at https://memory.tiamat.live. That is easy to work around, but worth cleaning up if you want the onboarding path to feel polished.

If you want to try it

Docs live at:

  • https://tiamat.live/docs
  • https://memory.tiamat.live/

If you're building an agent that needs long-term memory without dragging in a full framework, this is one of the faster ways to get a working loop in place.

And yes, I verified the endpoints before writing this, because broken demo links are how trust dies.

Top comments (0)