Parameter Definitions
1. Full-Text Search Configuration
Full-text search combines traditional keyword-based search with vector similarity search. The configuration is defined inalita_sdk/runtime/tools/vectorstore.py:
enabled(bool): Activates full-text searchweight(float): Weight for text search scores (0.0-1.0), combined with vector scoresfields(list): Metadata fields to search (e.g., βcontentβ, βtitleβ, βdescriptionβ)language(str): Language for text search indexing (e.g., βenglishβ, βspanishβ)
2. Reranking Configuration
Reranking applies custom scoring rules to boost or demote search results based on metadata. Defined in bothVectorStoreWrapper and VectorStoreWrapperBase:
field_name: Metadata field to apply rules toweight(float): Score multiplier when rules matchrules:contains(str): Boost if field contains this substringpriority(str): Boost if field exactly matches this valuesort(str): Sort direction (βascβ or βdescβ) based on field value
3. Extended Search
Extended search retrieves documents by searching across multiple chunk types (title, summary, propositions, keywords) and then fetching the full document chunks:"title": Search document titles"summary": Search document summaries"propositions": Search extracted propositions"keywords": Search extracted keywords"documents": Search full document chunks (default behavior)
How These Parameters Work Together
The search flow inVectorStoreWrapperBase.search_documents() processes these parameters sequentially:
Dynamic Usage Example: Agent Query
Hereβs a comprehensive example showing how an agent can dynamically use these parameters:Scenario: Searching Technical Documentation
User Query: βFind recent API authentication changes in the security documentationβ Agentβs Dynamic Search Strategy:How the Agent Determines Parameters
The agent analyzes the query to extract:- Keywords for full-text search: βauthenticationβ, βsecurityβ, βAPIβ
- Temporal context: βrecentβ β sort by
updated_ondescending - Document type hints: βdocumentationβ β filter by doc_type
- Semantic concepts: βchangesβ β use extended search to find summaries
Search Execution Flow
Implementation Details
Full-Text Search Implementation
The full-text search uses PostgreSQLβs full-text search capabilities viaPGVectorSearch in alita_sdk/runtime/tools/pgvector_search.py:
Reranking Implementation
The reranking logic in_apply_reranking() method:
Extended Search Implementation
Extended search retrieves documents by searching specialized chunk types:Agent Integration Example
Hereβs how an agent would use these parameters in a real conversation:Best Practices
- Full-Text Search Weight: Use 0.2-0.4 for balanced hybrid search
- Extended Search: Use for document discovery when you need context beyond exact matches
- Reranking: Apply multiple rules with decreasing weights (0.5, 0.3, 0.2)
- Cutoff Threshold: Use 0.5-0.7 for quality filtering
- Search Top: Request 2-3x desired results before filtering
π Files Referenced:
alita_sdk/runtime/tools/vectorstore.pyβ Main vector search implementation withSearchDocumentsModelandVectorStoreWrapperclass containing search logicalita_sdk/runtime/tools/vectorstore_base.pyβ Base classVectorStoreWrapperBasewith core search methods includingsearch_documents(),_apply_reranking(), and extended search implementationalita_sdk/tools/base_indexer_toolkit.pyβBaseIndexerToolkitshowing how search tools are exposed to agents viaget_available_tools()alita_sdk/tools/elitea_base.pyβBaseVectorStoreToolApiWrapperdemonstrating toolkit integration patterns