Pluggable memory architecture using local ChromaDB / Qdrant to store agent task history, architectural decisions, and repository context across sessions.
Agent Memory & Semantic Vector Search Plugin
Overview
The Agent Memory & Vector Plugin provides persistent semantic memory across coding sessions. It indexes repository architectural decisions, past bug fixes, and user preferences into a local vector database (ChromaDB or Qdrant), allowing agents to query context dynamically.
Architecture
[ Agent Prompt ] --> [ Semantic Search Query ] --> [ Local Chroma Vector Index ]
|
[ Top K Relevant Snippets ]
|
[ Injected Context ]
Plugin Usage Example (Python / Chroma)
import chromadb
from chromadb.utils import embedding_functions
client = chromadb.PersistentClient(path="./.agents/memory_db")
collection = client.get_or_create_collection(name="repo_memory")
def recall_past_decisions(query: str, top_k: int = 3):
results = collection.query(query_texts=[query], n_results=top_k)
return results["documents"][0]
def store_decision(doc_id: str, decision_text: str, metadata: dict):
collection.upsert(
documents=[decision_text],
metadatas=[metadata],
ids=[doc_id]
)
Key Benefits
- Zero Hallucination of Project Rules: Recalls exact historical rationale behind specific refactors or architecture constraints.
- Session-to-Session Persistence: Retains context even when switching branches or restarting the IDE.