Module memory

Module memory 

Source
Expand description

Memory and RAG (Retrieval-Augmented Generation) System

Provides persistent context, knowledge retrieval, and semantic search for agents.

§Features

  • Vector Store: Semantic similarity search using embeddings
  • Memory Types: Short-term, long-term, episodic, and semantic memory
  • Knowledge Base: Structured document storage with chunking
  • Context Window: Smart context management for LLM prompts
  • Caching: Frequently accessed information caching

Structs§

AgentCache
Simple LRU cache for agent computations
CacheEntry
Cache entry
ChunkingConfig
Configuration for document chunking
ContextSegment
A segment of context
ContextWindow
Manages context for LLM prompts
Document
Document for the knowledge base
DocumentChunk
A chunk of a document
KnowledgeBase
Knowledge base for RAG
MemoryConfig
Configuration for the memory manager
MemoryEntry
Memory entry representing a piece of stored knowledge
MemoryManager
Unified memory manager for agents
MemoryStats
Memory statistics
OpenAIEmbedding
OpenAI embedding provider
SearchResult
Search result from vector store
VectorStore
Vector store for semantic search
VectorStoreConfig
Configuration for the vector store
VectorStoreStats
Vector store statistics

Enums§

ChunkingStrategy
Chunking strategies
ContextSegmentType
Types of context segments
DocumentType
Document types
EmbeddingModel
Embedding model options
MemoryError
Memory system errors
MemorySource
Source of memory entry
MemoryType
Types of memory
SimilarityMetric
Similarity metrics for vector search

Traits§

EmbeddingProvider
Trait for embedding providers

Type Aliases§

Embedding
Vector embedding (typically 384-1536 dimensions depending on model)
MemoryId
Unique identifier for memory entries