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

When you search agent memory, SwarmClaw runs two searches in parallel:

  1. FTS5 keyword search — Fast exact and prefix matching using SQLite's full-text search engine
  2. 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

ProviderModelNotes
Local (Free)all-MiniLM-L6-v2Runs in Node.js, no API key, no cost, works offline
OpenAItext-embedding-3-smallRequires OpenAI API key
Ollamanomic-embed-text (or any)Runs locally, no API key needed

Configuration

  1. Go to Settings in the sidebar
  2. Under Embeddings, select a provider
  3. Choose a model (or use the default)
  4. If using OpenAI, select a credential with an API key
  5. 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