Understand TypeAgent Storage: Collections and Indexes
mainThe Storage Layer uses two primary abstractions to manage knowledge: Collections for data storage and Indexes for efficient retrieval.
Collections
MessageCollection: Stores conversation messages with ordinal indexing.SemanticRefCollection: Stores semantic references and knowledge artifacts.
Indexes
TypeAgent uses six specialized indexes to support different query patterns:
SemanticRefIndex: Maps terms toSemanticReffor content discovery.PropertyIndex: Maps property names toSemanticReffor structured queries.TimestampToTextRangeIndex: Enables temporal navigation and filtering.MessageTextIndex: Provides embedding-based semantic similarity search.RelatedTermsIndex: Handles term expansion and alias resolution.ConversationThreads: Organizes threads and groups context.
Storage Providers
You can choose between two providers that implement the same API:
MemoryStorageProvider: In-memory storage for fast access; data is lost when the process ends.SqliteStorageProvider: SQLite-backed storage for persistent data.