Introduction#

The :py:class:`~evofabric.core.vectorstore module in EvoFabric provides a comprehensive vector database solution designed for efficient text storage, retrieval, and similarity search operations. Built with a modular architecture, it supports various vector database backends and provides both synchronous and asynchronous APIs.

Overview#

The :py:`~evofabric.core.vectorstore` module provides the following functions:

  • Multi-backend support: Currently includes the ChromaDB implementation, and the architecture is extensible to support other vector databases.

  • Flexible Integration: Seamless integration with embedded clients, supporting automatic text vectorization

  • Comprehensive API Suite: Comprehensive text addition, similarity search, database management, metadata processing methods

  • Asynchronous Support: Full asynchronous API support for high-performance applications

  • Metadata Management: Filtering and metadata-based search functionality

Core Components#

The module includes several key components:

  1. DBBase: Defines the abstract base class for the basic vector database interface.

  2. VectorDB: An enhanced abstract class with advanced vector operations

  3. ChromaDB: production-ready ChromaDB implementation

  4. Data Type: used for structured data processing DBItem and SearchResult

Usage Scenario#

vectorstore The module is suitable for:

  • Retrieval-Augmented Generation (RAG): Store and retrieve relevant documents to provide LLM context

  • Semantic Search: Implement similarity-based search on text corpora

  • Document Management: Store, index, and retrieve documents with metadata

  • Knowledge Base: Building and Managing Knowledge Retrieval Systems

  • Content Recommendation: Search for similar content based on semantic similarity

Architectural Advantages#

  • Modular Design: Easy to extend with new vector database backends

  • Type Safety: Comprehensive type annotations and Pydantic validation

  • Error Handling: Error Handling and Recovery Mechanisms

  • Performance: Optimized for speed and memory efficiency

  • Flexibility: Support for custom embedding functions and metadata filtering