praval.memory.long_term_memory๏
Long-term vector memory using Qdrant for Praval agents
This provides persistent, vector-based storage for: - Semantic knowledge and concepts - Long-term conversation history - Learned patterns and insights - Cross-session memory persistence
Classes
|
Qdrant-based long-term memory for persistent vector storage |
- class praval.memory.long_term_memory.LongTermMemory(qdrant_url='http://localhost:6333', collection_name='praval_memories', vector_size=1536, distance_metric='cosine')[source]๏
Bases:
objectQdrant-based long-term memory for persistent vector storage
Features: - Vector similarity search - Persistent storage across sessions - Scalable to millions of memories - Semantic search capabilities - Memory importance scoring
- __init__(qdrant_url='http://localhost:6333', collection_name='praval_memories', vector_size=1536, distance_metric='cosine')[source]๏
Initialize long-term memory
- store(memory)[source]๏
Store a memory entry with vector embedding
- Parameters:
memory (
MemoryEntry) โ The memory entry to store- Return type:
- Returns:
The ID of the stored memory
- retrieve(memory_id)[source]๏
Retrieve a specific memory by ID
- Parameters:
memory_id (
str) โ The ID of the memory to retrieve- Return type:
- Returns:
The memory entry if found, None otherwise
- search(query)[source]๏
Search memories using vector similarity
- Parameters:
query (
MemoryQuery) โ The search query- Return type:
- Returns:
Search results with matching memories