retriever_init
Signature
- Initializes retrieval service.
- Embedding Backend (backend): Responsible for converting text/images into vectors (Infinity, SentenceTransformers, OpenAI, BM25).
- Index Backend (index_backend): Responsible for vector storage and retrieval (FAISS, Milvus).
- Demo Mode: If is_demo=True, forces OpenAI + Milvus configuration, ignoring some parameters.
retriever_embed
Signature
- (Non-Demo Mode) Batches calculation of vector representations of corpus and saves as .npy file.
- Only applies to Dense Retriever backend (BM25 not supported).
retriever_index
Signature
- Builds retrieval index.
- FAISS: Reads embedding_path (.npy) to build local index file.
- Milvus / Demo: Reads corpus_path (.jsonl), generates vectors and inserts into specified collection_name.
retriever_search
Signature
- Retrieves single or multiple queries.
- Automatically handles query vectorization (adds query_instruction) and finds Top-K in specified collection_name (for Milvus) or default index.
retriever_batch_search
Signature
- Batch version of retriever_search, accepts nested list input.
bm25_index
Signature
- When
backend="bm25", builds BM25 sparse index and saves it.
bm25_search
Signature
- Keyword retrieval based on BM25 algorithm.
retriever_deploy_search
Signature
- As a client, calls remote retrieval service deployed at retriever_url for query.
retriever_exa_search
Signature
- Calls Exa Web retrieval (requires
EXA_API_KEY).
retriever_tavily_search
Signature
- Calls Tavily Web retrieval (requires
TAVILY_API_KEY).
retriever_zhipuai_search
Signature
- Calls ZhipuAI
web_search(requiresZHIPUAI_API_KEY).
Configuration
servers/retriever/parameter.yaml
backend_configs Sub-items:
sentence_transformers_encode Parameters:
index_backend_configs Parameters: