Context Engine Design
The Context Engine extracts knowledge from every query response and uses it to enrich future queries.
What It Does
- Extract — After each response, the Context Engine identifies key facts (atomic facts) in the response
- Embed — Each fact is embedded using a local embedding model and stored in the knowledge base
- Retrieve — When a new query arrives, the Context Engine searches for relevant facts and enriches the query with them
How It Enriches Queries
When a new query arrives:
- The query is embedded
- The Context Engine searches for similar facts in the knowledge base
- Relevant facts are added to the query context
- The enriched query is sent to the LLM
This means the LLM receives not just the user's query, but also relevant context from previous interactions — without the user having to provide it.
Document Ingestion
In addition to extracting facts from responses, the Context Engine can ingest external documents:
- Navigate to Context in the sidebar.
- Upload documents (text, markdown, PDF).
- The Context Engine extracts facts from the documents.
- These facts are available for enriching future queries.
Privacy and Data Isolation
- All facts are scoped to the organization — no cross-organization data sharing
- Facts are stored in the organization's database
- Embedding generation runs locally — no external API calls