Skip to main content

Overview

(Memory Unit) is ArgentOS’s built-in persistent memory system. It supports two backends:
  • PostgreSQL 17 + pgvector (recommended) — concurrent access, shared knowledge, HNSW vector indexes, tsvector full-text search with GIN indexes
  • SQLite (fallback) — single-process, local-only, FTS5 full-text search, stored at ~/.argentos/memory.db
The installer sets up PostgreSQL by default. SQLite is available as a zero-dependency fallback for simpler setups.

Database Schema

The core memory table contains:
ColumnTypeDescription
idINTEGERPrimary key
contentTEXTThe memory content
typeTEXTCategory (fact, preference, event, relationship, etc.)
significanceINTEGERImportance score (1-10)
entitiesTEXTJSON array of referenced entities
emotional_contextTEXTEmotional tone or context
sourceTEXTWhere this memory came from
created_atTEXTTimestamp of creation
updated_atTEXTLast update timestamp
embeddingBLOBVector embedding for semantic search
MemU uses different full-text search engines depending on the backend: PostgreSQL (default): tsvector with GIN indexes — supports ranked search, stemming, language-aware tokenization, and phrase matching. SQLite (fallback): FTS5 extension — boolean queries, phrase matching, prefix matching. Both backends support:
  • Boolean queries: preference AND open-source
  • Phrase matching: "infrastructure specs"
  • Prefix matching: config*
  • OR queries: telegram OR discord

Search Tips

  • Single keywords work best for broad recall
  • Use OR for multi-word queries to improve recall
  • Strip common stop words for better results
  • PostgreSQL handles stemming and language-aware tokenization automatically

Significance Scoring

Every memory has a significance score from 1-10:
ScoreLevelExample
1-2LowPassing observations
3-4MediumUseful context
5-6HighImportant facts and preferences
7-8Very HighKey personal information, critical decisions
9-10CriticalCore identity, security-sensitive data
Higher significance memories are prioritized in search results and bootstrap injection.

Auto-Capture

The agent is trained to automatically store important information without being explicitly asked. When it detects a new fact, preference, event, or relationship in conversation, it calls memory_store proactively.

Embeddings

MemU supports vector embeddings for semantic similarity search. Embeddings are generated when memories are stored and used alongside full-text search for hybrid ranking. PostgreSQL: pgvector with HNSW indexes for fast approximate nearest neighbor search. SQLite: sqlite-vec extension for local vector search.
Final Score = text_relevance * weight + embedding_similarity * weight + significance_boost

Storage

PostgreSQL (default):
postgres://localhost:5433/argentos    # Database with pgvector extension
Redis on port 6380                    # Agent state, presence, pub/sub
SQLite (fallback):
~/.argentos/memory.db      # Main database
~/.argentos/memory.db-wal  # Write-ahead log
~/.argentos/memory.db-shm  # Shared memory
The database is accessed via getMemuStore() in src/memory/memu-store.ts.