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