Skip to main content
WardenOpen-source AI scannerExplore →
Engineering

Building Universal Memory: Stateful AI at Scale

Gilad GabayDecember 28, 20251 min read

How we designed Universal Memory to give your AI persistent context across sessions. PostgreSQL, pgvector, and intelligent memory extraction.

Building Universal Memory: Stateful AI at Scale

LLMs are stateless by design. Every conversation starts fresh. Universal Memory is our solution.

The Architecture

  1. Memory Extraction - LLM extracts memorable facts
  2. Vector Storage - pgvector with HNSW indexing
  3. Context Injection - Relevant memories injected into prompts

7 Memory Types

  • Instructions - System guidance
  • Preferences - User choices
  • Projects - Active work
  • Skills - Capabilities
  • Facts - Known info
  • Relationships - Connections
  • Corrections - Learnings

Performance

  • Retrieval Latency: less than 10ms
  • Storage per User: ~1KB per memory
  • Max Memories: 1000 per user
#memory#architecture#pgvector
Share

Gilad Gabay

Co-Founder & Chief Architect

We use cookies for analytics to understand how visitors use our site. No advertising cookies. Privacy Policy