Your agent forgets users between sessions. That's the bug.
MemexAI gives your agent a persistent memory layer backed by Postgres. Memories are human-readable Markdown files with revision history, access logs, and scoped permissions. You can inspect every fact, fix mistakes, and trace what the agent remembered and why.
Paste the prompt into Cursor, Claude, or Antigravity to automate setup.
Three ways agent memory fails in production
Stateless agents lose users
Without persistent memory, your agent starts fresh every session. Users repeat their preferences, re-explain their goals, and eventually stop coming back. The AI feels like it has amnesia.
Vector stores should not be the source of truth
Dumping conversations into a vector database retrieves similar-looking fragments — including outdated or conflicting ones. When the agent says something wrong, you need an editable memory record, not just a nearest neighbor.
Agents can't distinguish rules from facts from history
Everything ends up in a single context blob. The agent doesn't know what must always apply, what's true about this user, and what happened in the past. Memory without structure is just noise.
Memory as Markdown files in your Postgres
MemexAI stores what your agent knows about each user as structured Markdown files — not embeddings as the source of truth. Files live in your own Postgres database. Optional pgvector ranking can improve recall, while the memory record stays readable and editable.
user/**Private per tenantEach user gets their own memory directory. Agents read and write freely. Other users can't see it.
shared/**Global read-onlyProject-wide policies, style guides, and workflows. Agents read but can't write by default.
Give all your agents a shared brain
The shared/ namespace holds global policies, product schemas, and behavioral rules. Update a schema or rule once, and it instantly propagates to every agent session. No code deployments required.
Behavioral Rules
Store shared/playbook.md to define how agents should handle specific situations (e.g., support escalations). The agent reads it before every session.
Memory Schemas
Define what a "good" user profile looks like. If you add a new required field to the schema, agents will automatically start asking users for it.
Auto-Injection
shared/index.mdis automatically injected into every prompt block. It acts as a routing catalog for your agent's collective knowledge.
Collective Memory
Optionally configure shared/ as read-write. Trusted agents can update project canon, backed by full audit trails and the ability to revert any change.
Background Dreaming keeps memory clean
Memory files can get messy over time with duplicate facts or scattered notes. MemexAI's Dreaming is a background optimization loop that runs when a user session goes quiet.
Merges repeated preferences, removes outdated or corrected facts, and consolidates fragmented notes into a stable record without blocking the main user request.
Dream runs that find nothing to change complete silently. When they do make updates, they create normal revisions authored by the dream-agent.
When the AI gets a fact wrong, open the file and fix it.
Edit the Markdown line, and the next prompt block updates instantly. Hybrid deployments refresh optional pgvector ranking on writes. Revisions track every write. Access logs track every read. You can trace exactly which tool call wrote the wrong fact.
Add memory to your agent in 4 lines
Start with Docker. Connect with the TypeScript SDK or MCP. Or paste a setup prompt into your coding agent and let it wire everything automatically.
memory subagentRecommended defaultGive the model memory_remember and memory_context; MemexAI decides what is durable, retrieves relevant context, and handles file bookkeeping.
raw file toolsExact file controlUse file-level tools when your app or agent owns the memory layout and needs exact path control over durable files.
How MemexAI compares
Give your agent memory your team can trust.
Start with Docker, MCP, or the TypeScript SDK. Store memory, inject context, verify the next answer changes.