AI Best Practices
Data agents are only as good as the context they are given. An LLM can write SQL, but on its own it does not know what your tables mean, which values actually exist in them, or how your analysts define "active customer" or "Q4 revenue". Timbr provides that context as a governed context layer between your data and your agents.
This page explains what the context layer is made of and walks through six steps to make a Timbr ontology AI-ready.
Why data agents fail without context
When an agent is pointed directly at warehouse tables, the same three problems keep appearing:
| Problem | Example |
|---|---|
| No business meaning | The schema is cryptic, so the agent guesses joins, columns and intent on every question. "Pipeline" is a standard sales term, but no single column is called that. |
| No grounding in real values | The user asks about "AmEx", but the data stores AMERICAN EXPRESS COMPANY. A relative period like "last quarter" is interpreted against the system clock rather than the data that actually exists. |
| No institutional memory | The query an analyst carefully wrote and verified last week is forgotten. The same answer is reinvented each time, often slightly differently, and sometimes wrongly. |
A better model alone does not solve these. Each one is a missing piece of context.
The Timbr context layer
Timbr combines several kinds of context into one layer that every agent, BI tool and SQL client shares:
| Layer | Answers | Provided by |
|---|---|---|
| Structural | What does the data mean? | Ontology: concepts, relationships, inheritance, measures and descriptions, queryable as SQL |
| Technical | What is actually in the data? | Ontology profiling: statistics and real values that let the agent match a user's words to the literal values stored in the source |
| Interpretive | How does this organization use the data? | Knowledge Bases: approved question-to-SQL examples, definitions and rules |
| Conversational | What has this user already asked? | Data agent conversation memory, so follow-up questions are understood in context |
Around all of these sit Timbr's governance controls: permissions and row-level security, SQL validation, and a full audit trail of agent activity.
Why an ontology
Metric layers standardize how measures are calculated, and data catalogs help people find data. An ontology goes further: it describes the business itself. It states that a High-Value Customer is a Customer, that a Customer has Accounts, and that Revenue is calculated in exactly one way.
For an agent this means:
- Relationships replace guessed joins. The agent traverses named relationships defined in the model instead of inventing join conditions.
- Logic is defined once. Measures, calculated properties and logical concepts (such as Active Customer) give every consumer the same answer.
- Inheritance is built in. Querying a parent concept includes its child concepts automatically.
- Sources stay where they are. One model can span several warehouses and databases without moving data.
The ontology gives the agent the grammar of the business, not just its vocabulary.
Why a Knowledge Base
The ontology is the authoritative, structural definition. Much of what analysts know is not structural: which date to use by default, which orders count as revenue, how a department phrases a question. That knowledge usually lives in chat threads, wiki pages and people's heads.
A Knowledge Base captures it in a governed form. Approved answers become context for future questions, and corrections from users become suggestions a reviewer can accept. Over time, the Knowledge Base becomes an asset that improves with use instead of knowledge that disappears when a session ends.
When an agent answers a question, it uses this knowledge in one of three ways:
- Reuse an approved query when one clearly answers the question.
- Follow related approved examples as guidance when the match is partial.
- Reason from the ontology alone when there is no precedent. The result is still governed and validated.
Six steps to an AI-ready ontology
Run the steps in order for a new use case, then keep them up to date as the business and data change.
| Step | Adds | Result |
|---|---|---|
| 1. Create the ontology | Semantic context | The AI knows what the data means |
| 2. Profile the ontology | Technical context | The AI knows what is really in the data |
| 3. Add Knowledge Bases | Institutional knowledge | The AI answers the way your experts would |
| 4. Define data agents | Guardrails | The AI is scoped, consistent and auditable |
| 5. Run benchmarks | Validation | The AI is measured and approved |
| 6. Deploy data agents | Natural-language access | Users get answers in the tools they already use |
1. Create the ontology
Model the business, not the tables.
- Business concepts. Create one concept per business entity and map it to the tables or views that hold its data.
- Relationships. Define how concepts relate so the agent follows the model rather than guessing joins.
- Measures and calculated properties. Define each KPI once in the ontology so every consumer gets the same number.
- Logical concepts. Name the subsets the business talks about, such as Active Customer, Churn Risk or Open Incident.
- Descriptions. Describe concepts, properties and relationships. Descriptions are what the agent reads when deciding what to use, so they matter as much as the structure.
- Tags (optional). Mark units, PII, ownership, certification level or domain for finer control over what agents see.
Mapping tables one-to-one and leaving descriptions empty. The agent then sees a database, not a business.
See Modeling in Timbr, the Ontology Explorer and Ontology & Governance Best Practices for modeling and governance guidance.
2. Profile the ontology
Give the agent the shape of your data.
- Run a profiling analysis to collect statistics for each property, such as non-null counts, distinct value counts, value ranges (minimum and maximum) and top-k values.
- Why it matters. Statistics help the agent pick the right concept and level of detail, and match real filter values (for example
AMERICAN EXPRESS COMPANYfor "AmEx") instead of inventing them. - Re-profile after changes to mappings, source systems or model structure, not only on a timer.
- Treat freshness as a control. Schedule a recurring profiling job that matches your data refresh cycle. A daily load deserves a daily profile.
Profiling once at go-live. Statistics age with every load, so schedule recurring profiling.
If you cache data, chain a profiling job after your cache refresh jobs so statistics follow every load.
See Profile Ontology, the ANALYZE ONTOLOGY SQL reference, Ontology Readiness and Scheduled Jobs.
3. Add Knowledge Bases
Capture how your experts ask and answer.
- Golden examples. Pair real business questions with validated Timbr SQL, covering the questions this use case exists to answer.
- Rules. Record default filters, time grains, terminology, exclusions and explicit guidance on what the agent must never do.
- Speak the users' language. Capture synonyms, acronyms and department-specific wording, not just the names used in the model.
- Scope by audience. Create separate Knowledge Bases when rules would otherwise conflict: one per domain, team or region.
- Grow from real usage. Every corrected answer should become a new example or rule. This is how institutional knowledge compounds.
See Knowledge Bases in the platform and the Knowledge Base SQL reference.
4. Define data agents
Scope the access and configure the interaction.
- Bind the context. Attach the ontologies and the specific Knowledge Bases this agent should use.
- Limit the scope. Expose only the concepts, views and properties the use case needs. A narrowly scoped agent is more accurate for its team.
- Configure the behavior. Set SQL validation and retries, reasoning, graph depth and conversation settings.
- Configure the interaction. Provide instructions, answer style, row limits and any additional context the agent should follow.
See Data Agents and Manage LLMs.
5. Run benchmarks
Measure accuracy before users rely on the answers.
- Benchmark LLMs. Run a set of predefined questions and expected answers across different LLM providers and models.
- Benchmark data agents. Test each agent against the same questions to confirm its configuration.
- Learn and improve. Review the results, improve the ontology, Knowledge Base or agent, then run the benchmark again.
- Reuse what passes. Import correct benchmark questions into your Knowledge Bases as golden examples.
See Benchmarks.
6. Deploy data agents
Give users governed natural-language access to data.
- Publish to where users work. Serve agents through MCP, the API, chat tools such as Microsoft Teams and Slack, or BI tools, all from the same governed context.
- Review and iterate. Read the conversation history and feed every gap back into the ontology (step 1) and the Knowledge Bases (step 3).
- Monitor activity. Track agent usage across tools, including full conversations and step-by-step execution traces.
- Learn from feedback. User feedback on answers becomes suggestions for the bound Knowledge Bases, ready for review.
See Ask Timbr, Data Agents Activity, MCP, Microsoft Teams and Slack.
Definition of ready
A use case is AI-ready when all six of the following are true:
| Criterion | Means |
|---|---|
| Described | Every concept, property and relationship the agent can see has a business description and is mapped to data. |
| Profiled | A profiling job is scheduled and its last run is within one data refresh cycle. |
| Exemplified | The questions this use case exists to answer are covered by validated golden examples in a Knowledge Base. |
| Ruled | The assumptions analysts make without thinking are written down as Knowledge Base rules. |
| Scoped | The agent sees only what it needs and passes a held-out set of real business questions in a benchmark. |
| Deployed | Users reach dedicated agents from their own tools, with different agents for different use cases. |
The maintenance loop
AI readiness is not a one-time project. Keep the context current with a continuous loop:
usage → gaps → ontology / Knowledge Base update → re-profile → re-benchmark
A single team querying a single warehouse can start with a narrow setup. As soon as you add more sources, more teams, cross-platform questions or want to reuse analysts' knowledge across agents, the context layer stops being an add-on and becomes the architecture. The investment in modeling and knowledge curation is paid back by answers that stay consistent across every agent and tool.