Building Production Analytics Agents with Semantic Layer Integration

wobby · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production analytics agents for business intelligence and text-to-SQL

Wobby needed analytics agents that business teams would actually use for ad-hoc questions over data warehouses. The challenge was not SQL syntax alone, but adoption in everyday channels, business-context grounding, semantic-layer governance, latency, testing, and avoiding raw-data access or brittle agent frameworks.

Constraints:

Architecture

Wobby built three analytics agents around an agent-first semantic layer. Quick handles everyday questions, Deep handles open-ended research, and Steward helps build and maintain the semantic layer. The analytics agents operate over the logical semantic layer rather than raw data, while Steward can inspect physical-layer information and suggest dimensions, metrics, and KPIs. Slack and Teams integrations drive adoption and expose real failures to support staff. The codebase uses clean interfaces and API wrappers instead of heavyweight agent frameworks, tests obvious bugs in CI before evals, evaluates agent trajectories with composite quality metrics, and uses caching, compression, pruning, and progressive disclosure for latency.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  business-users["Business users"] --> slack-and-teams-channels["Slack and Teams channels"]
  slack-and-teams-channels --> quick-agent["Quick agent"]
  slack-and-teams-channels --> deep-agent["Deep agent"]
  quick-agent --> semantic-layer["Semantic layer"]
  deep-agent --> semantic-layer
  semantic-layer --> sql-compiler["SQL compiler"]
  sql-compiler --> data-warehouse["Data warehouse"]
  data-warehouse --> physical-data-layer["Physical data layer"]
  steward-agent["Steward agent"] --> physical-data-layer
  steward-agent --> semantic-layer
  steward-agent --> semantic-layer-environments["Semantic layer environments"]
  semantic-layer-environments --> semantic-layer
  customer-support-observers["Customer support observers"] --> slack-and-teams-channels
  customer-support-observers --> trace-and-eval-feedback["Trace and eval feedback"]
  quick-agent --> trace-and-eval-feedback
  deep-agent --> trace-and-eval-feedback
  trace-and-eval-feedback --> observability-wrappers["Observability wrappers"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Slack and Teams channels Business-user collaboration surfaces where analytics questions, peer examples, onboarding, and failure observations happen. Business users, Quick agent, Deep agent, Customer support observers
Business users Ask analytics questions, see peers use agents, and report incorrect answers or missing business context. Slack and Teams channels, Quick agent, Deep agent, Steward agent
Quick agent Answers straightforward everyday analytics questions using semantic-layer business logic. Business users, Semantic layer, SQL compiler, Trace and eval feedback
Deep agent Handles more open-ended, research-style analytics questions over the governed logical layer. Business users, Semantic layer, SQL compiler, Trace and eval feedback
Semantic layer Logical business abstraction containing metrics, dimensions, KPIs, and reusable SQL concepts between raw data and dashboards. Quick agent, Deep agent, Steward agent, SQL compiler, Semantic layer environments
SQL compiler Translates logical semantic-layer references into SQL dialects for warehouse execution. Semantic layer, Data warehouse
Data warehouse Aggregated customer data source that Wobby currently targets instead of joining across many raw systems. SQL compiler, Physical data layer
Physical data layer Raw tables, catalogs, documentation, and warehouse structures that inform semantic-layer construction. Data warehouse, Steward agent
Steward agent Suggests semantic-layer edits, dimensions, metrics, and KPIs by inspecting physical-layer context and documentation. Physical data layer, Semantic layer, Semantic layer environments, Business users
Semantic layer environments Separate test/merge lifecycle for semantic-layer changes before production use. Steward agent, Semantic layer
Trace and eval feedback Captures channel failures, tool trajectories, eval items, and composite quality scores for agent improvement. Quick agent, Deep agent, Customer support observers, Observability wrappers
Customer support observers Watch customer channels, identify bad answers, and convert them into test or eval items. Slack and Teams channels, Trace and eval feedback
Observability wrappers Decorators and wrappers that capture function inputs/outputs and forward traces to LangFuse and Logfire. Trace and eval feedback

Data flow

Business users ask analytics questions through Slack, Teams, or Wobby's interface. Quick or Deep receives the request, uses business-context prompts and the semantic layer to reason over metrics, dimensions, and logical entities, then compiles requests through Wobby's SQL compiler to the relevant dialect. Steward helps create and update semantic-layer entities from documentation or physical-layer inspection, with changes tested in environments before merge. Failures observed in customer channels become test or eval items. Traces flow through observability wrappers that call LangFuse and Logfire.

5 supporting quotes
“We have the quick agent that is for everyday straightforward questions. We have the deep agent which is more open-ended researchy.”transcript, stated
“straightforward questions. We have the deep agent which is more open-ended researchy. And then we have the steward agent which helps you to build a semantic layer. And so the semantic layer is something that encodes the business logic and that helps the quick and deep agents um actually”transcript, stated
“the semantic layer is something that encodes the business logic and that helps the quick and deep agents um actually use that business logic effectively. This is our success formula. Um it's quite beefy so I'll chop it down for you. And the first thing is”transcript, stated
“our own set of APIs and our own sort of SQL compiler that will like have a reference to entities in the logical layer”transcript, stated
“we define our own decorators and then we use both lockfire and and length use. Um, and then we we actually call them both.”transcript, stated

Why this architecture

Wobby found that business-context grounding mattered more than raw SQL generation. Raw schemas and golden-query RAG did not match how BI teams govern metrics, while a semantic layer matched existing BI concepts and kept analytics agents away from raw data. A separate Steward agent lets semantic-layer quality improve over time, while Slack/Teams channels make adoption and failure discovery social. Clean architecture and wrappers avoided early framework churn and let Wobby keep responsibilities in the app layer or agent layer as needed.

5 supporting quotes
“the problem is not the syntax um SQL syntax not a problem. It's just the context around the data that's often a problem.”transcript, stated
“we actually gave the analyst agent this logical representation instead of the raw SQL um to encode a bit more of that business logic.”transcript, stated
“analytics one never has access to data right to raw data it only has access to the logics >> yes >> okay >> and then the steward one now how often does the steward agent also if I heard you right it's also is it also suggesting dimensions and measures and”transcript, stated
“for our use case, we really needed to have direct control over what goes where because we have an app and an agent layer”transcript, stated
“adoption of an agent is more than just a chat chat UIX in in chat. It's actually more like a group and group feeling”transcript, stated

Models used: LLM analytics agents · LLM judges · OpenAI harmony message format · small language models

Scale

Alternatives considered (roads not taken)

Parameterized golden-query RAG over reusable SQL templates

Rejected because: It produced too many similar queries and review work, and did not align with BI teams' day-to-day process.

“our first approach was to build a sort of agent that works with rack and having a set of query queries that he can reuse.”transcript, stated
“100 plus similar looking SQL queries and that created even more work for the analysts to review. And overall this wasn't really in line with how they operated the the BI process dayto-day. Um so one note to myself would be to really think about the the”transcript, stated

Use only existing semantic layers such as Cube or dbt Metric Flow

Rejected because: Wobby needed an agent-first integration layer across many semantic layers, APIs, and SQL dialects.

“either we're going to use cube or we're going to like use dbt metric flow or we're going to like build a like direct integration”transcript, stated
“we build a semantic layer ourselves because of course in our product we need to integrate with many semantic layers.”transcript, stated

Adopt MCP/tool-server and multi-agent-network frameworks

Rejected because: Separate tool servers, ReAct prompting, and multi-agent networks added context, complexity, and debugging burden for this product.

“having a separate server where our tools were executed wasn't really useful. So, we didn't go with that. React prompting wasn't useful as well.”transcript, stated
“multi-agent networks was really also not useful because that's even more context, even more agents and even harder to debug.”transcript, stated

Build a cross-data-source query engine first

Rejected because: Wobby stayed pragmatic by working with single data teams that already aggregate data in a warehouse, instead of solving cross-source joins initially.

“Do we need to sort of build a query engine that connects with various data sources and like have cross data source joins?”transcript, stated
“we've chosen not to do that yet. Um because of we currently work with a single data team and they typically have a data warehouse”transcript, stated

Patterns

multi-agent-orchestration (agent-architecture)

Wobby separates everyday analytics, open-ended analysis, and semantic-layer stewardship into Quick, Deep, and Steward agents with distinct access boundaries.

“We have the quick agent that is for everyday straightforward questions. We have the deep agent which is more open-ended researchy.”transcript, stated
“you can already see by this agent system that it's multiple agents together, but it fits better with the the process and how BI teams operate.”transcript, stated

data-quality-loop (semantic-grounding)

The semantic layer encodes business logic, metrics, dimensions, and governed definitions so agents improve as teams add missing context and eval items.

“semantic layer is actually the thing that we need for accurate guardrails and goods embedded in in the business process.”transcript, stated
“gradually building that semantic layer that is actually the the the source of success of the agents”transcript, stated

tool-use-orchestration (agent-tools)

Analytics agents call semantic-layer and SQL-compiler capabilities, while Wobby tests tool outputs as software bugs before relying on evals.

“a certain tool or a semantic search not yielding the correct results would be a bug in the tool or the semantic search.”transcript, stated
“if it's not succeeding the test then we know that something's off and we don't we cannot ship that agent.”transcript, stated

eval-driven-development (quality)

Real channel failures and team usage become eval items, while composite trajectory metrics compare agent configurations over representative datasets.

“we can then add that to a sort of eval item for the client and ensure that that mistake gets debugged”transcript, stated
“overall agent effectiveness score that allows us to across different runs doesn't matter how the agent um ends”transcript, stated

latency-optimization (operations)

Wobby optimizes agent response time with progressive disclosure, prompt-side intent handling, schema compression, message pruning, JSON compression, caching, and interleaved thinking.

3 supporting quotes
“the faster your agent, the the faster the more it will get used.”transcript, stated
“we scrapped the fixed workflows and we move more towards progressive disclosures.”transcript, stated
“caching is very important for your system prompt when it gets to a certain size and tools as well.”transcript, stated

observability-tracing (operations)

Function decorators and wrappers capture LLM inputs/outputs and forward traces into both LangFuse and Logfire without coupling the app directly to one vendor API.

“So a decorator is a nice way to encapsulate entering a function and then whatever happens with a function even if it errors”transcript, stated
“Lenfuse is really it's open source and it's it's useful to really dig into the the trace and see what the agent what goes into the LLM”transcript, stated

prompt-versioning (agent-logic)

Wobby prefers portable prompt-contained logic for this domain because it is easier to compare, test, and deploy than workflow topology changes.

“a prompt is the only thing that encodes logic and it becomes easier to really test and compare and deploy various configurations of an agent”transcript, stated

Tradeoffs

Build an agent-first semantic layer

Chose Own integration layer, APIs, and SQL compiler over logical entities over Relying only on existing semantic-layer APIs or raw warehouse schemas.

Rationale: Wobby needed cross-platform interoperability and agent-first semantics for accurate, governed analytics behavior.

“we build a semantic layer ourselves because of course in our product we need to integrate with many semantic layers.”transcript, stated
“context is everything for Texas SQL. So actually we we sort of did a like light pivot into hey actually we need to build a semantic layer”transcript, stated

Prioritize Slack/Teams integration early

Chose Native collaboration-channel adoption work over Treating channel UX as a later chat-box wrapper.

Rationale: The channel experience created group adoption, peer examples, onboarding, and live failure capture, but required more engineering than expected.

“start with this um integration of Slack teams sooner rather than later because they require more like require more time to get rides than you think”transcript, stated
“there's a healthy set of peer pressure that allows people to actually start using the agent”transcript, stated

Use tests before evals for early production bugs

Chose Layered automated tests for prompt/tool/API failures over Putting all quality checks into evals.

Rationale: Tests catch deterministic bugs cheaply in CI, while evals measure comparative agent performance on representative tasks.

“ear on the test on the side of more test cases before starting to do evals.”transcript, stated
“evolve is really then more for hey how is the agent really performing on like this this sample of data set”transcript, stated

Put more domain logic in prompts

Chose Portable prompt-based agent logic over Rigid workflow branching for this analytics domain.

Rationale: As instruction-following improved, prompts became easier to compare, A/B test, and deploy than many workflow paths.

“we we earned more on the side of putting more logic in the prompts um because it's easier to to actually like be more portable and to test.”transcript, stated
“when you have a workflow in any LLM completion something can go wrong. So you need to test in every subpad.”transcript, stated

Target single aggregated data warehouses first

Chose Warehouse-bounded deployments over Cross-source joins across many non-interoperable systems.

Rationale: Single data-team/warehouse contexts kept the problem bounded while cross-source query engines remained a future possibility.

“we've chosen not to do that yet. Um because of we currently work with a single data team and they typically have a data warehouse”transcript, stated

Gotchas (what bit them)

Text-to-SQL benchmark performance hides production context failures.

Root cause: SQL syntax is not the hard part; agents need business context, governed metrics, and logical concepts.

Resolution: Move agents from raw SQL/data toward a semantic layer that encodes business logic.

“these benchmarks has have many broken ambiguous queries and even the best teams in the world, they see that the performance of their agents stalls at 80%.”transcript, stated
“the problem is not the syntax um SQL syntax not a problem. It's just the context around the data that's often a problem.”transcript, stated

Golden-query RAG can increase analyst review workload.

Root cause: A library of parameterized SQL examples created many similar queries rather than reusable BI abstractions.

Resolution: Replace query-template reuse with a semantic layer of metrics, dimensions, and logical business entities.

“what we ended up with was 100 plus similar looking SQL queries and that created even more work for the analysts to review.”transcript, stated
“our second version was a sort of realization that hey we need to encode business logic more efficiently”transcript, stated

Putting basic tool bugs into evals makes debugging harder.

Root cause: Access-management failures, bad tool formatting, and missing API data are deterministic bugs, not agent-performance questions.

Resolution: Catch failure modes and happy paths in automated tests and reserve evals for comparing agent behavior and configurations.

“we noticed whenever we run stuff that we have certain things that are actually not part of an eval. It's just okay this is just a bug.”transcript, stated
“let's spare on the side of having certain failure modes or certain things where we expect a tool to output a certain thing and put that as a fixed test”transcript, stated

Agent frameworks and multi-agent networks can add unnecessary context and debugging complexity.

Root cause: Wobby needed direct control over app-layer versus agent-layer responsibilities, and extra agents increased context load.

Resolution: Use clean interfaces, wrappers, a factory, and selective abstractions instead of adopting unsuitable frameworks wholesale.

“we went with clean Bob clean code from uncle Bob and we used uh like an interface uh like a clean interface”transcript, stated
“multi-agent networks was really also not useful because that's even more context, even more agents and even harder to debug.”transcript, stated

A well-governed semantic layer is a prerequisite, not a nice-to-have.

Root cause: Many companies lack trustworthy data and shared definitions, so agents receive wrong context and output wrong answers.

Resolution: Work with data engineering teams to build semantic layers, governed datasets, and logical abstractions that agents can use safely.

“many companies don't have like trustful like trustworthy data and so if you just unleash an agent on their data it will probably just be have the wrong context”transcript, stated
“we are on board to help them build a sort of semantic layer or a sort of data set that agents work well with.”transcript, stated

Evaluation

Wobby uses layered tests for deterministic bugs, eval items from real user/channel failures, a Streamlit job-container eval app, trajectory analysis, multiple LLM judges, reasoning-first structured judging, and an Overall Agent Effectiveness-style composite score.

Metrics: Fixed tests for tool output, prompt formatting, service downtime, and semantic-search/access bugs. · Eval items added from customer-channel failures. · Tool trajectory counts by step and next tool call. · Multiple judges to reduce evaluator variance. · Reasoning-first structured output for judge explanations. · Overall Agent Effectiveness composite weighted score across trajectories.

5 supporting quotes
“if you have a failure mode, put it in a test case. If you have a happy pad, put it in a test case”transcript, stated
“we can then add that to a sort of eval item for the client and ensure that that mistake gets debugged”transcript, stated
“we went with a simple uh streamllet um app that can spawn as a job container”transcript, stated
“we also use multiple judge to reduce the variance when we use an evaluator.”transcript, stated
“we wanted to some score like that overall agent effectiveness score”transcript, stated

Outcomes

The source describes two years of development, production use in logistics and finance analytics contexts, and a goal of under-one-minute insights, but does not provide total query volume.

4 supporting quotes
“Um and in this talk I'll share the sort of the success formally I wished we'd had when we started building WBY about two years ago. I'll keep it short and sweet because we only have 50 minutes and it will be an opinionated talk.”transcript, stated
“these are the chats from one of our uh customers who adopted a logistics agent and a finance analyst.”transcript, stated
“we actually gave the analyst agent this logical representation instead of the raw SQL um to encode a bit more of that business logic.”transcript, stated
“we for our use case we saw definitely you users using it a lot and being helpful for like ad hoc questions for the BI team.”transcript, stated