Bounded Data Agent

Governed retrieval-augmented data agent platform
40 nodes

/projects/boundeddata

Bounded Data Agent

08

A production-oriented TypeScript framework for governed data agents: the model plans and explains, deterministic tools compute, and governance gates every bounded, read-only query — with sampling, verification and full audit traces.

Project context05

Problem

Enterprise data agents are risky when models can write arbitrary SQL or cite unverified retrieval. Teams need bounded, read-only querying with deterministic verification and audit traces.

Solution

Bounded Data Agent separates model planning from deterministic tools: semantic query, hybrid search, sampling, profile SQL, bounded SQL, verification, evaluations, and audit trace are distinct stages.

Challenges

The system must constrain SQL scope, preserve database safety, verify sampled answers, support vector retrieval, and explain how every answer was produced without exposing uncontrolled database access.

Innovation

The architecture treats the model as planner and explainer while typed tools perform computation. Governance is built into the retrieval and SQL path rather than bolted on after generation.

Domain expertise

This shows Stefan's command of governed RAG, Postgres/pgvector, Drizzle schemas, LangGraph-style flows, SQL safety, verification harnesses, and audit-focused data-agent design.

Case study evidence11

Outcomes

  • Lets enterprise users ask questions over data while keeping SQL execution bounded, read-only, and auditable.
  • Makes answer provenance visible through retrieval, sampling, SQL, verification, and trace records.
  • Demonstrates a safe pattern for data agents that need to work with production-like warehouses.

Architecture decisions

  • Semantic layer and hybrid retrieval run before raw SQL so the model does not jump directly to tables.
  • Bounded SQL and verifier stages constrain and check the exact computation path.
  • Audit traces record question, plan, tool calls, SQL, evidence, and answer for review.

Domain expertise signals

Governed RAGSQL safetyPostgresAudit tracesEnterprise data agents
Technical deep dive09

Bounded Data Agent is a governed analytics system for model-assisted querying. Its depth is in keeping the model as planner and explainer while deterministic tools do retrieval, SQL, verification, and audit.

Semantic-first access

The agent starts with a business semantic layer and hybrid retrieval before raw SQL. That keeps questions aligned with domain concepts instead of table spelunking.

SQL guardrails

Bounded SQL is scoped, read-only, and policy-approved. The model can request computation, but it does not get unrestricted warehouse authority.

Verification loop

Sampling, profiling, and verifier stages make answers harder to fake. The system checks data quality and result plausibility before the final response.

Audit model

Questions, plans, tool calls, SQL, evidence, and answers are recorded so an enterprise reviewer can reconstruct how a conclusion was produced.

What this proves

  • Postgres and pgvector in one governed boundary
  • Semantic query before bounded SQL
  • Verifier stage before answer writing
  • Audit trace records every meaningful step
9pipeline stages
7index layers
5governance gates
6tool families
1semantic layer first
provenance + audit
Technology stack08
TypeScript

TypeScript

Keeps the planner, tool executor, policy objects, and answer contracts typed end to end.

Node.js

Node.js

Fits the HTTP and CLI runtime while staying close to the TypeScript agent framework.

Pg

PostgreSQL

Acts as the governed warehouse, catalog store, document index, and audit-friendly source of truth.

vec

pgvector

Keeps semantic retrieval inside Postgres so vector search and relational governance share one boundary.

Dz

Drizzle ORM

Provides typed schema, migrations, and seeds without hiding the SQL policy layer.

Dk

Docker

Makes the data agent reproducible with Postgres and local services available for testing.

Vi

Vitest

Gives fast unit and evaluation checks for policy, query, and verifier behavior.

LG

LangGraph

Matches the explicit retrieve, sample, execute, verify, answer pipeline shape.

Tools implemented08

Semantic query

Asks the business semantic layer before touching raw warehouse tables.

Hybrid search

Combines keyword and vector retrieval across documents, graph data, and embeddings.

Sampling plan

Chooses representative data before the agent attempts broader analysis.

Profile SQL

Inspects distributions and data quality so answers can state limits honestly.

Bounded SQL

Allows only guard-approved, scoped, read-only SQL to execute.

Verifier

Checks results deterministically before the answer writer responds.

Eval harness

Scores fixture runs against thresholds so quality can be tracked.

Audit trace

Records the question, plan, tool calls, SQL, and evidence for review.

Stefan Creadore · @Eldergenixproduction agent systems mapped end to end