The Wren Journal

Product

How Wren AI turns a question into an answer

Ask in plain language. Wren retrieves the right business context, writes and validates the SQL, and runs it against your own database.

Jasmine Nguyen

Updated: Oct 04, 2026
Published: Oct 04, 2026

How Wren AI turns a question into an answer

A text-to-SQL answer can look instant, but the useful work happens between the question and the chart. Wren has to identify the right business context, generate SQL against that context, validate it, enforce access, and run it on the connected data source.

This walkthrough opens that process up. Follow one question through the five stages.

Try the interactive walkthrough

The loop highlights each stage automatically. Select Run the question at any time to restart it.


Frequently asked questions

Is memory shared across a project or private to each user?

Wren uses two types of memory:

  • Instructions and Knowledge Base content are shared across the project. They include business logic, schema definitions, and semantic knowledge.
  • Agent Memory is specific to each user and is not shared with other users.

What happens if someone teaches Wren something incorrect?

Incorrect information can affect other users only when it is published to the shared Knowledge Base. Changes remain drafts until publication, and the publishing workflow summarizes created, updated, and deleted rules.

Team members can review, edit, or remove incorrect rules. Git-based version control, generated SQL, answer provenance, evaluation workflows, and thread tracing help teams identify the context behind an answer and correct it.

What data does Wren AI Cloud send to an AI model?

Depending on the workflow and configuration, the model receives the context required to answer the question:

  • The user's question
  • Relevant schema metadata, including tables and columns
  • MDL definitions and business knowledge
  • Some sampled values used for profiling
  • Aggregated results used to summarize the answer

Wren does not send a bulk copy of your database or use customer data to train public foundation models. Queries execute against the connected source. Enterprise Plus with BYO LLM can keep AI processing inside your own environment when full data residency is required.

Can administrators control model access and AI spending?

Yes. In self-hosted deployments, administrators control the LLM API keys configured for each project. Provider-level controls can restrict model access, monitor consumption, and apply spending limits or quotas.

How Wren connects to one or more databases?

For a single data source, Wren uses query pushdown. It transpiles generated queries into the source's SQL dialect and executes them inside the source database.

For multiple sources, organizations can use a Trino connection or organization-level MCP connectors. Performance and cost depend on data volume, source systems, network latency, and cross-source query patterns.

What happens when identity-directory information is stale?

RLS and CLS use the identity context supplied by your identity provider. Stale or inaccurate directory data can cause over-permissioning or under-permissioning. Wren enforces the identity information it receives but does not independently reconcile directory accuracy.

Audit logs, thread tracing, and identity-provider access reviews help teams detect problems. Directory governance remains the customer's responsibility.

Do Teams, Slack, MCP, and embedded applications enforce the same security policies?

Yes. These interfaces use the same governed access layer and inherit the semantic model, permissions, RLS and CLS policies, and audit trail.

Per-user enforcement depends on the identity configuration. When an integration uses a service account, session properties must map each user to the correct security context.

Is Wren optimized for a particular AI model?

No. Wren is model-agnostic. We support providers including OpenAI, Azure OpenAI, Anthropic Claude through Amazon Bedrock, Google Gemini through Vertex AI, and local or custom models.

Different pipeline stages can use different models. Wren recommends validated models for reliable performance, but customers are not locked into one provider.

What auditability is available for AI-generated answers?

Wren provides visibility into user activity, session context, generated SQL, and answer provenance. Enterprise plans also include audit logs, the Evaluation Framework, and thread tracing.

Generated SQL remains inspectable, so teams can validate how an answer was produced instead of relying on a black-box response.

Which embedding model does Wren use, and can it be replaced?

Wren uses OpenAI embedding models by default.

Self-hosted deployments can substitute local embedding models. Wren manages embeddings for Cloud deployments, where they are not customer-configurable.

How does Wren select relevant tables, columns, and relationships?

Wren uses semantic retrieval rather than sending the complete schema to the model. It draws on your MDL models, business knowledge, and previously validated questions to find the relevant tables, columns, and relationships.

Validation and evaluation workflows help confirm the result.

How does Wren handle schemas with hundreds or thousands of tables?

Wren does not send the entire schema to the model. It retrieves only the relevant parts of your semantic model for each question.

This keeps the prompt bounded as the overall schema grows.

Share this post
Stay updated

See governed GenBI in action

Watch short demos of Wren AI turning business questions into governed SQL, charts, and reusable GenBI apps.

Watch product demos

The Wren Journal

Get the next deep dive in your inbox

Practical GenBI guides, product updates, and customer lessons from the Wren AI team. A couple of emails a month, no noise.