Files
docker-agent/examples/rag/custom_provider.yaml
T
David Gageot 5c8319add3 feat: support custom providers in RAG embedding and reranking models
Thread the Providers map from the agent config through RuntimeConfig,
ManagersBuildConfig, and BuildContext so that custom provider definitions
(e.g. a local Ollama instance with a custom base_url) are applied when
creating embedding and reranking model providers.

Add a NewProvider helper on both ManagersBuildConfig and BuildContext to
encapsulate the repeated provider.New + WithGateway + WithProviders
pattern. Consolidate duplicate resolveModelConfig logic in builder.go
by reusing strategy.ResolveModelConfig.

Also fixes missing WithProviders in semantic_embeddings.go chat model
creation and missing WithGateway in reranking provider creation.

Closes #1701

Assisted-By: docker-agent
2026-04-07 17:11:42 +02:00

41 lines
1.1 KiB
YAML

# This example demonstrates using a custom provider for RAG embedding models.
# For instance, you can use a local Ollama instance or any OpenAI-compatible
# API endpoint for generating embeddings.
providers:
local-ollama:
base_url: http://localhost:11434/v1
models:
local-embed:
provider: local-ollama
model: nomic-embed-text
agents:
root:
model: openai/gpt-5-mini
description: assistant with RAG using custom embedding provider
instruction: |
You are a helpful assistant with access to a knowledge base.
Use the search tool to find relevant information before answering.
toolsets:
- type: rag
ref: knowledge_base
rag:
knowledge_base:
tool:
description: search the knowledge base for relevant information
docs:
- ./docs
strategies:
- type: chunked-embeddings
embedding_model: local-embed # References the model defined above using the custom provider
database: ./custom_provider.db
vector_dimensions: 768
chunking:
size: 1000
overlap: 100
results:
limit: 5