Enhanced retrieval accuracy using Anthropic’s contextual retrieval technique
useModel(TEXT_EMBEDDING)
from your agent setup. Do NOT try to mix different embedding models - all your documents must use the same embedding model for consistency.Document Size | Pages | Chunks | Without Caching | With OpenRouter Cache |
---|---|---|---|---|
Small | 10 | ~20 | $0.02 | $0.002 |
Medium | 50 | ~100 | $0.10 | $0.01 |
Large | 200 | ~400 | $0.40 | $0.04 |
CTX_KNOWLEDGE_ENABLED=true
(not “TRUE” or “True”)TEXT_PROVIDER
and TEXT_MODEL
are both setUse OpenRouter for Cost Efficiency
Keep Default Settings
Monitor Your Logs
Use Appropriate Models
CTX_KNOWLEDGE_ENABLED=true
and configure your text generation provider to get started!