Archived project — the hosted API is no longer running. Source code and full docs remain available.
Memory API for AI Agents

Your agents finally
remember everything

Persistent memory API for AI agents. Store and recall across runs.

One POST to remember. One GET to recall. Persistent semantic memory for every agent — no vector DB setup required.

pgvector semantic search
Cosine similarity recall
Framework agnostic
memstore.dev/v1/memory
Store a memory
const res = await fetch('https://memstore.dev
  /v1/memory/remember', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'User prefers dark mode,
      uses React, timezone UTC-5',
    session: 'user_8821',
    ttl: 2592000 // 30 days
  })
});
Recall semantically
// GET /v1/memory/recall?q=user+preferences

// Response:
{
  "memories": [{
    "id": "mem_k9x2...",
    "content": "User prefers dark
      mode, uses React...",
    "score": 0.97,
    "session": "user_8821",
    "age": "2 hours ago"
  }],
  "tokens_used": 142
}

Two calls.
That's the whole API.

The entire surface area, as it was documented when the service ran.

Store a memory
POST
curl -X POST https://memstore.dev/v1/memory/remember \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"User prefers dark mode, uses React"}'
Recall semantically
GET
curl "https://memstore.dev/v1/memory/recall?q=user+settings" \
  -H "Authorization: Bearer YOUR_KEY"

# {"memories":[{"content":"User prefers dark mode,
#   uses React","score":0.97,"age":"2h ago"}]}

AI agents forget everything
between runs

Every session starts from zero. Your agent has no idea what the user said last week, what decisions were made, or what it already tried. That's not intelligence — that's amnesia.

🔁

Repeated questions

Agents ask users the same things over and over. Every run re-discovers what should have been remembered.

🌀

Context stuffing

Dumping entire conversation history into every prompt is expensive, slow, and hits context limits fast.

🎭

Hallucinating history

Without real memory, agents make up plausible-sounding facts about past interactions. Users notice.

Try it yourself

No API key needed. Select a memory, store it, then recall it semantically.

memstore.dev — live demo
01 Store
02 Recall
03 Agent
Step 1 — Store a memory
curl -X POST https://memstore.dev/v1/memory/remember \
  -H "Authorization: Bearer am_live_..." \
  -d '{"content": "...", "session": "user_8821"}'
Select a memory to store:
User prefers dark mode, uses React, timezone UTC-5
user_8821
Agent decided to use PostgreSQL for the database
task_42
Customer Sarah reported billing issue on March 15th
support_991
API rate limit is 1000 req/min for the Pro tier
shared
// Response 201 Created
Step 2 — Recall semantically
Try these queries (wording doesn't have to match exactly):
editor preferences
what database did we choose
billing complaint
API limits
UI theme settings
// Results ranked by semantic similarity
Step 3 — Inside your agent
# Before every agent run
memories = ms.recall("user preferences", session="user_8821")
context = "\n".join([m["content"] for m in memories])

# Inject into your LLM prompt
prompt = f"Context:\n{context}\n\nTask: {user_task}"

# After learning something new
ms.remember("User switched to Vue.js", session="user_8821")
Agent now has persistent memory across every run

Every run starts with full context. No re-explaining. No hallucinating past decisions.

How it was built

A small, deliberately boring stack. Two endpoints doing real work, and one SQL function doing the interesting part.

API
Node.js + Express REST API deployed on Railway
Datastore
Supabase Postgres with the pgvector extension for semantic search
Embeddings
OpenAI text-embedding-3-small — 1536 dimensions
Recall
Cosine similarity through a Postgres RPC function, filtered by agent, session, and TTL
Billing
Stripe subscriptions with webhook idempotency backed by a processed-event table
Auth
Bcrypt-hashed API keys with prefix-based lookup caching
Rate limiting
Per-plan hourly limits persisted in Postgres, so counters survive restarts and scale past one instance
Integrations
MCP server for native use inside Claude Desktop and Cursor
SDKs
First-party Python and Node clients wrapping the REST API

The recall function

Recall is one round trip. The API embeds the query, then hands the vector to Postgres, which does filtering, scoring, and ranking in a single indexed pass — no candidate set is ever shipped back to Node for re-ranking.

database/functions.sql
-- Semantic recall (cosine similarity via pgvector)
CREATE OR REPLACE FUNCTION recall_memories(
  p_agent_id   UUID,
  p_embedding  VECTOR(1536),
  p_session    TEXT  DEFAULT NULL,
  p_top_k      INT   DEFAULT 5,
  p_threshold  FLOAT DEFAULT 0.5
)
RETURNS TABLE (
  id          UUID,
  content     TEXT,
  session     TEXT,
  metadata    JSONB,
  score       FLOAT,
  created_at  TIMESTAMPTZ
)
LANGUAGE SQL AS $$
  SELECT
    m.id,
    m.content,
    m.session,
    m.metadata,
    1 - (m.embedding <=> p_embedding) AS score,
    m.created_at
  FROM memories m
  WHERE
    m.agent_id = p_agent_id
    AND (p_session IS NULL OR m.session = p_session)
    AND (m.ttl IS NULL OR m.ttl > NOW())
    AND 1 - (m.embedding <=> p_embedding) >= p_threshold
  ORDER BY m.embedding <=> p_embedding
  LIMIT p_top_k;
$$;

<=> is pgvector's cosine distance operator, so 1 - distance gives a similarity score in the same expression that drives the sort. The ORDER BY on the raw distance is what lets the ivfflat index serve the query; ordering on the derived score column instead would force a sequential scan.

What is persistent memory
for AI agents?

Persistent memory for AI agents is the ability to store facts, decisions, and context outside the agent runtime and retrieve them semantically on future runs. Unlike context window stuffing, persistent memory scales across sessions, reduces token costs, and gives agents long-term recall without manual state management.

Three calls.
Memory that survived the run.

01

Remember

POST any text — facts, decisions, user preferences, tool outputs. Memstore embeds it automatically and indexes it for semantic search.

02

Recall

GET with a natural language query. Returns the most relevant memories ranked by semantic similarity — not just keyword matches.

03

Run forever

Every agent run starts with full context. No loops, no repeated work, no hallucinating past decisions. Your agent gets smarter over time.

What your agent needs
to remember

Not a vector DB tutorial — a memory layer with agent-native primitives.

Semantic recall

pgvector cosine similarity returned the right memories even when the query wording differed. Agents did not need exact matches to remember.

Session isolation

Memories were tagged by user, task, or run, and recall could span sessions or stay inside a single scope. Isolation was enforced in the SQL, not just the app layer.

TTL + auto-expiry

Any memory could carry a time-to-live. Short-lived task context expired on its own; long-term facts persisted. Expiry was filtered inside the recall query itself.

LLM-parseable errors

Every error response carried a machine-readable code, a human-readable message, and a suggested fix, so an agent could retry correctly without a human in the loop.

Webhooks on update

Webhooks fired when memories were created, updated, or expired, so agent state could be synced across services or trigger downstream work.

Built for every
agent type

What it was used for, from customer-facing bots to internal automation pipelines.

🎧

Customer support bots

Bots that recalled a customer's history, past tickets, and preferences, so nobody had to repeat themselves on every contact.

💼

Sales & outreach agents

Agents that tracked every prospect interaction, objection, and follow-up, holding deal context across weeks of back-and-forth.

🤖

Personal AI assistants

Assistants that actually knew the user — preferences, projects, habits, goals — and got more useful with each interaction.

🔗

Multi-agent pipelines

State shared across agent handoffs: one agent stored a decision, another recalled it ten steps later, with no message-passing spaghetti.

Works with your
existing stack

No SDK required — any language that could make an HTTP request worked with Memstore.

Python
# LangChain / CrewAI / any agent
import requests

requests.post(
  "https://memstore.dev/v1/memory/remember",
  headers={"Authorization": f"Bearer {api_key}"},
  json={"content": "User prefers dark mode"}
)
Node.js
// Any JS agent or framework
await fetch(
  "https://memstore.dev/v1/memory/remember",
  { method: "POST",
    headers: { Authorization: `Bearer ${apiKey}` },
    body: JSON.stringify({
      content: "User prefers dark mode"
    })
  }
)

You could. Here's what
that actually looks like.

Rolling your own agent memory sounds like a weekend project. It isn't.

01

Set up pgvector

Configure Postgres, enable the extension, tune ivfflat list count, manage migrations. Then do it again for staging.

02

Wire OpenAI embeddings

Call the embedding API on every store and recall. Handle rate limits, retries, model versioning, and dimension mismatches.

03

Build session scoping

Design an agent isolation model, session namespacing, and access controls. Get it wrong and agents bleed context into each other.

04

Implement TTL cleanup

Write cron jobs to expire stale memories. Handle edge cases. Don't delete things that haven't expired yet. Debug at 2am.

05

Add usage metering

Track ops per agent, enforce limits, handle overages gracefully. Wire into billing. Keep counts consistent under concurrent load.

06

Or just use Memstore

Two REST calls, done in an afternoon — the point was to spend the time on the agent, not the plumbing.

Stop building infrastructure.
Start building agents.

How the alternatives compared at the time Memstore was running.

Feature Self-hosted pgvector Pinecone / Weaviate Memstore (as built)
Setup time 2–4 hours ~1 hour Minutes, once you had a key
Embedding logic Manual Manual Automatic
Maintenance High Medium Handled by the service
API style SQL + drivers Heavy SDK Simple REST
Cost to start $25+/mo Usage + fees Free tier, then $19/mo

The whole API surface

Four endpoints. Bearer auth. JSON in, JSON out. Structured errors an agent could act on. No SDK was required, though Python and Node clients shipped alongside it.

POST/v1/memory/remember
GET/v1/memory/recall?q=...
DEL/v1/memory/forget/:id
GET/v1/memory/list
DB schema
Error format
-- memories table (Supabase pgvector)
CREATE TABLE memories (
  id        uuid PRIMARY KEY,
  agent_id  uuid REFERENCES agents,
  session   text,
  content   text NOT NULL,
  embedding vector(1536),
  metadata  jsonb,
  ttl       timestamptz,
  created_at timestamptz DEFAULT now()
);

-- cosine similarity index
CREATE INDEX ON memories
  USING ivfflat (embedding vector_cosine_ops)
  WITH (lists = 100);

Usage-based pricing. No seats. No surprises.

Pricing as designed when the service was live.

Pay for what your agents use. Free tier generous enough to build your first production agent.

1 operation = 1 store or recall call. Most agent runs use 20–100 ops.

Free
$0
forever
No card was required
  • 1,000 operations/month
  • 50MB memory storage
  • Semantic recall
  • Session isolation
Free tier
Pro
$49
per month
  • 500,000 operations/month
  • 10GB memory storage
  • Priority support
  • Custom TTL policies
  • Usage analytics
$49 / month

Common questions

What frameworks did Memstore work with? +
Any framework that can make HTTP requests. LangGraph, CrewAI, AutoGen, custom MCP/A2A setups, plain Python, Node.js — if it could call a REST API, it worked with Memstore. No framework-specific SDK was required, though optional Python and Node clients shipped alongside it.
How was this different from using Supabase directly? +
Memstore handled embedding generation, index management, TTL enforcement, session scoping, and usage metering behind two endpoints. Using Supabase directly means wiring all of that yourself — embedding calls, vector index tuning, cleanup jobs. Memstore was the layer that absorbed it.
What embedding model did it use? +
OpenAI text-embedding-3-small (1536 dimensions), chosen for its cost/quality ratio. The Pro tier was designed to switch to text-embedding-3-large for higher recall accuracy on complex queries.
How was an "operation" counted? +
Each API call counted as one operation — one remember, recall, forget, or list — metered per agent against the plan quota.
How was agent data isolated? +
Each API key was scoped to an isolated agent namespace, and every query filtered on agent_id inside the SQL function itself, so no memory was reachable across keys. Stored data was never used to train models.
What happened when an operation limit was reached? +
Recall kept working read-only, while new remember calls returned a 429 with a JSON error an agent could parse rather than a bare status code. A usage alert fired once at 80% of quota.

Your data stays yours

Agent memory holds sensitive data, so these were the guarantees the service was designed around.

🔒

Encrypted in transit and at rest

Memories were stored in Postgres with encryption at rest and served over TLS only.

🌍

Isolated namespaces

Every API key operated in its own namespace. Isolation was enforced in the recall SQL function, not just the application layer.

📦

Data stayed yours

Stored memories and queries were never used to train models. The list and forget endpoints made export and deletion self-service.

🔑

Revocable keys

Keys were bcrypt-hashed and could be rotated or revoked, each scoped to a single agent namespace.

The service is off.
The engineering is still here.

Backend, SDKs, MCP server, and Postgres schema are all readable in the repo.

View source on GitHub →
Node.js + Express
Supabase Postgres + pgvector
Python + Node SDKs
Companion project

AI Hub — where Memstore was used

AI Hub is a free multi-AI dashboard: chat with ChatGPT, Claude, Gemini, Grok, and local Ollama models side by side. It was the first real consumer of this API — every conversation's persistent memory ran through Memstore, which made it the proving ground for session scoping and recall quality. AI Hub is still running; it no longer depends on Memstore.

  • Broadcast one message to all AIs at once
  • Run structured debates between models
  • Used Memstore for cross-session memory
  • Free to use — bring your own API keys
AI Hub
ChatGPT
The relay feature turns parallel threads into one collaborative conversation...
Claude
Debate mode is where it gets interesting — AIs react to each other's answers...
Memory synced via Memstore (2026)