Memory
SwarmClaw provides persistent memory for agents using a hybrid search system combining keyword matching and semantic embeddings.
Storage
Memories are stored in a SQLite database (data/memory.db) with FTS5 full-text search indexing. Each memory has:
- Title — Short label for the memory
- Content — Full text content
- Agent — Which agent owns this memory
- Tags — Optional categorization tags
- Embedding — Optional vector embedding for semantic search
Hybrid Search
When you search agent memory, SwarmClaw runs two searches in parallel:
- FTS5 keyword search — Fast exact and prefix matching using SQLite's full-text search engine
- Vector similarity search — Cosine similarity against stored embeddings (if configured)
Results from both searches are merged and deduplicated, giving you the best of both approaches: exact matches for specific terms and semantic matches for related concepts.
Embeddings
To enable semantic search, configure an embedding provider in Settings.
Supported Providers
| Provider | Model | Notes |
|---|---|---|
| Local (Free) | all-MiniLM-L6-v2 | Runs in Node.js, no API key, no cost, works offline |
| OpenAI | text-embedding-3-small | Requires OpenAI API key |
| Ollama | nomic-embed-text (or any) | Runs locally, no API key needed |
Configuration
- Go to Settings in the sidebar
- Under Embeddings, select a provider
- Choose a model (or use the default)
- If using OpenAI, select a credential with an API key
- Save
New memories will automatically get embeddings. Existing memories without embeddings still work via FTS5 keyword search.
Per-Agent Memory
Each agent has its own memory space. Memories created during a session are tagged with the agent ID. When an agent searches memory, it only sees its own memories.
API
Memory is managed through the agent's session context. Agents with memory enabled can:
- Store new memories during conversations
- Search their memory for relevant context
- Update existing memories with new information