How Wren AI works
Wren AI combines a product UI, an AI service, and a context engine so users can ask business questions without working directly from raw database schemas.

The three core services
Wren UI
Wren UI is the user-facing application. It is where you:
- connect data sources
- define models and relationships
- ask questions
- review answers, charts, and saved results
Wren AI Service
Wren AI Service handles retrieval, prompting, SQL generation, and result validation. It is responsible for turning a user question into a grounded query workflow instead of sending a raw prompt directly to an LLM.
Wren Engine
Wren Engine provides the context and modeling foundation behind Wren AI. It manages metadata, business definitions, and SQL translation so the system can work from business-aware context instead of schema alone.
What happens when you ask a question
At a high level, the flow looks like this:
- You ask a question in Wren UI.
- Wren AI Service retrieves the most relevant business context for that question.
- Wren AI Service uses that context to generate SQL.
- Wren Engine validates and executes the query against the connected data source.
- Wren UI shows the answer, result preview, and any related chart or follow-up questions.
Why the system is split this way
These services are separate so Wren AI can keep responsibilities clear:
- Wren UI focuses on user workflow and interaction.
- Wren AI Service focuses on retrieval and generation.
- Wren Engine focuses on context, modeling, and execution.
That separation makes it easier to improve the system without forcing the UI, the AI workflow, and the business context layer into one tightly coupled service.
Learn more
- Read more about Wren AI Service
- Read more about Wren Engine
- Learn how the OSS product is structured in Wren AI OSS