Agent Memory Bridge
Agent Memory Bridge
AI-generatedSummary
Provide semantic memory management for AI Agent workflows by bridging conversation history, knowledge bases, and optional tools memory via vector stores. Retrieve relevant messages, handle deduplication and caching, and optionally perform entity extraction, consolidation, and summarization to maintain context for the agent.
Inputs
- Session ID (required) — String identifier used to separate conversation contexts and sessions.
- Top K — Number of most relevant messages to retrieve from the main vector store for semantic memory.
- Score Threshold — Minimum similarity score (0-1) for messages to be included in context retrieval; higher values filter more strictly.
- Include Recent Messages — Count of the most recent messages to always include in the context, regardless of similarity score.
- Enable Deduplication — Enable skipping saving exact duplicate messages to avoid redundant storage.
- Enable SimHash — Use SimHash algorithm to detect and skip near-duplicate messages for deduplication.
- SimHash Threshold — Hamming distance threshold (1-10) to determine similarity in SimHash deduplication; lower is stricter.
- Enable Response Caching — Cache responses for identical inputs to avoid reprocessing and reduce latency.
- Cache TTL (hours) — Time to live for cached responses; cache entries older than this (in hours) are ignored.
- Enable Persistent Cache — Persist cache entries in the vector store, surviving node or workflow restarts.
- Knowledge Bases — Configure one or more read-only knowledge base vector stores with conditional activation, each with separate Top K and Score Threshold settings. Contents included as system messages in the agent context.
- Skills Knowledge Base Top K — Number of most relevant documents to retrieve from a connected Skills Knowledge Base (specialized procedures/recipes).
- Skills Knowledge Base Score Threshold — Minimum similarity score (0-1) for including documents from the Skills Knowledge Base.
- Separate Tools Memory — When enabled, stores and retrieves tool interaction messages in a separate vector store to isolate tools' context from conversation memory.
- Tools Memory Top K — Number of relevant tool interaction messages to retrieve when Separate Tools Memory is enabled.
- Tools Memory Score Threshold — Minimum similarity score (0-1) for including messages from tools memory.
- Include Recent Tools — Number of most recent tool interaction messages to always include regardless of similarity score.
- Search Timeout (ms) — Maximum time to wait for each search operation (in milliseconds) before timing out.
- Max Retries — Number of retry attempts for failed searches, with exponential backoff delay.
- Retry Delay (ms) — Initial delay before retrying a failed search, increasing exponentially with each retry.
- Max Cache Size — Maximum number of entries maintained for each internal cache (content hash, SimHash, response, embedding), using LRU eviction.
- Enable Auto Cleanup — Automatically clean expired messages and enforce maximum message limits per session based on TTL or max messages settings.
- Message TTL (days) — Time-to-live for messages; messages older than this are subject to auto cleanup if enabled.
- Max Messages Per Session — Maximum number of messages to keep per session; oldest messages removed when exceeded if auto cleanup enabled.
- Enable Metrics — Enable collection of performance metrics including search times, cache hit rates, and knowledge base usage.
- Enable Memory Processing — Enable advanced memory processing features such as entity extraction, message consolidation, and summarization, requiring an LLM model for advanced modes.
- Extraction Mode — Mode for extracting structured entities from messages: None, Basic (regex-based), or Advanced (LLM-based).
- Consolidation Mode — Method for consolidating similar messages to reduce redundancy: None, Similarity (SimHash), or Semantic (Embeddings).
- Summary Mode — Method for summarizing old messages to reduce memory size: None, Threshold-based (when message count reaches threshold), or Periodic (every N hours).
- Summary Threshold — Number of messages before summary is triggered when using threshold-based summary mode.
- Summary Period (hours) — Hours between automatic summarizations when using periodic summary mode.
Output shape
An object containing key 'chat_history' with an array of message objects representing the semantic memory context for the agent.
The returned 'chat_history' array includes messages retrieved from conversation memory, optional tools memory, connected knowledge bases, and skills knowledge base if configured. Each message includes content, type (human, ai, tool, system), timestamps, and metadata for context. The history is filtered and ordered by semantic relevance and recency as configured.