local backend stores knowledge in an in-memory vector index from LlamaIndex. Knowledge text is embedded by an embedding model, written to an in-process vector index, and retrieved by similarity. It requires no external database but does require an embedding service, is the default backend for KnowledgeBase, and is ideal for local debugging and quick validation.
When to use
- Local debugging, teaching, or quickly validating a RAG flow;
- No external vector store required — only an embedding model.
Dependencies
Usage
Before running, configureMODEL_EMBEDDING_NAME, MODEL_EMBEDDING_DIM, MODEL_EMBEDDING_API_BASE, and MODEL_EMBEDDING_API_KEY. The extensions extra includes llama-index, embedding adapters, and vector-store connectors. Text is sent to the configured embedding service. For BytePlus or another provider, explicitly set the matching endpoint, model, and credentials; the default Ark endpoint does not automatically switch
backend_config:
Parameters
KnowledgeBase parameters
Constructor parameters
backend_config supports the following settings:
Embedding config
embedding_config is an EmbeddingModelConfig with env prefix MODEL_EMBEDDING_:
Environment variables
The local backend depends only on an embedding model and requires no database connection config. Text is automatically split into chunks by file type before embedding.