Skip to content
Back to site

Agent Memory

Hivekeep gives every Agent persistent long-term memory — a dual-channel system that combines automatic extraction with explicit storage, searchable via hybrid vector + full-text search.

After every LLM turn, Hivekeep runs an extraction pipeline that identifies important information from the conversation and saves it as memories. This happens silently in the background — the Agent doesn’t need to do anything.

Each extracted memory includes a source context — a brief description of the conversational context in which the fact was mentioned (e.g. “While discussing weekend plans, user mentioned…”). This gives memories episodic flavor, helping the Agent understand not just what was said but when and why.

Agents can also deliberately save information using the memorize tool:

memorize("Nicolas prefers dark mode and French responses", category: "preference", subject: "Nicolas")

Each memory has a category:

CategoryUse case
factObjective information (names, dates, technical details)
preferenceUser preferences and habits
decisionDecisions that were made and their rationale
knowledgeLearned domain knowledge

Memories have an importance score from 1-10. Higher-importance memories are prioritized during retrieval. The automatic pipeline and the Agent can both set importance.

Before each LLM turn, Hivekeep:

  1. Takes the current user message
  2. Optionally rewrites the query using recent conversation context for better semantic matching
  3. Searches memories using hybrid search: vector similarity (embeddings) + full-text keyword matching (FTS5)
  4. Injects the most relevant memories into the system prompt

This means the Agent always has relevant context without needing to explicitly recall information.

Agents can also search memory explicitly:

  • recall("Nicolas's infrastructure setup") — semantic + keyword search
  • list_memories(category: "decision") — browse by category
  • search_history("kubernetes deployment") — search past conversation messages
ToolPurpose
recallSearch memories (semantic + keyword, includes shared)
memorizeSave new information (private or shared)
update_memoryUpdate an existing memory (content, category, scope)
forgetDelete a memory
list_memoriesBrowse memories by category or scope
review_memoriesLLM-powered audit for contradictions, duplicates, stale entries
search_historySearch conversation message history

Memories default to private (only the owning Agent can see them), but Agents can mark memories as shared to make them searchable by all other Agents. This is useful for cross-domain facts like infrastructure details, user-wide preferences, or organizational decisions.

  • Use memorize(..., scope: "shared") or update_memory(..., scope: "shared")
  • recall automatically searches both private and shared memories
  • Shared memories include author attribution (e.g. [shared by Assistant])

When context usage exceeds the threshold (default: 75% of the model’s context window), Hivekeep compacts older messages into dated summaries. Key points:

  • Original messages are never deleted — they’re preserved in the database
  • Summaries accumulate chronologically — each compaction creates a new summary, not a single overwritten snapshot
  • When summaries exceed the budget, the oldest merge telescopically into higher-level summaries
  • Compacting is configurable per-Agent (threshold, keep window, summary budget, max summaries, model)
  • Users can force compact from the Agent’s settings at any time
  • Memories are per-Agent by default — each Agent has its own memory store
  • Shared memories are readable by all Agents but still owned by the creator
  • Vault secrets are never stored in memories (redaction prevents leaking into compacted summaries)