The opensearch backend uses OpenSearch as the vector store. Knowledge text is embedded by an embedding model, written to OpenSearch via LlamaIndex, and retrieved by similarity.
When to use
- You already run an OpenSearch cluster and want self-hosted vector search;
- You need persistence, sharing across processes and instances, and full control over indexing and retrieval.
Dependencies
Usage
You can also pass connection and embedding config explicitly via backend_config:
Parameters
Constructor parameters
backend_config supports the following settings:
OpenSearch connection config
opensearch_config is an OpensearchConfig with env prefix DATABASE_OPENSEARCH_:
Embedding config
embedding_config is an EmbeddingModelConfig with env prefix MODEL_EMBEDDING_:
Environment variables
index must follow OpenSearch naming rules: all lowercase, only a-z0-9_-., and not starting with _ or -; otherwise initialization fails. In production, set cert_path to enable certificate verification and avoid security risks.