So I figured it was about time I documented how to build persistent memory for AI agents using the databases you already know. Not vector databases - MySQL and Neo4j.
This isn't theoretical. I use this architecture daily, handling AI agent memory across multiple projects. Here's the schema and query patterns that actually work.
The Architecture
AI agents need two types of memory:
- Structured memory - What happened, when, why (MySQL)
- Pattern memory - What connects to what (Neo4j)
Vector databases are for similarity search. They're not for tracking workflow state or decision history. For that, you need ACID transactions and proper relationships.
The MySQL Schema
Here's the actual schema for AI agent persistent memory:
-- Architecture decisions the AI made
CREATE TABLE architecture_decisions (
id INT …[Read more]