Skip to main content

TableTalk

TableTalk defines trusted data agents as code. An Agent declares the relations, semantics, policies, and regression suites it may use. TableTalk compiles that source into a content-addressed artifact, shows a semantic plan, runs execution-based evals, and only applies the exact artifact that passed.

At runtime, an applied Agent produces a structured interpretation and query plan, validates generated SQL against its compiled scope, executes a read-only query, and returns claims tied to evidence and reproducible calculations. Missing models, database failures, empty evidence, and unsupported claims are reported explicitly. They are never replaced by heuristic or locally generated answers.

Free local development

Local development defaults to Ollama's free cloud model gemma4:31b-cloud. Ollama runs the OpenAI-compatible endpoint locally; the model itself is the cloud model.

ollama signin
ollama pull gemma4:31b-cloud

uv sync --extra duckdb
uv run tabletalk init
uv run tabletalk compile
uv run tabletalk plan
uv run tabletalk eval
uv run tabletalk apply
uv run tabletalk ask starter "How many customers are there?"

The generated tabletalk.yaml contains:

llm:
  provider: ollama
  model: gemma4:31b-cloud
  base_url: http://localhost:11434/v1
  api_key: ollama
  temperature: 0

Production is not tied to Gemma or Ollama. Configure any compatible model endpoint explicitly. TableTalk does not silently switch models or providers.

Install

pip install tabletalk
pip install "tabletalk[duckdb]"     # optional DuckDB driver
pip install "tabletalk[snowflake]"  # optional Snowflake driver

SQLite is included with Python. The supported database surface is deliberately limited to SQLite, DuckDB, and Snowflake.

Project layout

.
├── tabletalk.yaml
├── agents/
│   └── starter.yaml
├── evals/
│   └── starter.yaml
└── .tabletalk/              # generated, content-addressed local state
    ├── artifacts/
    ├── evals/
    ├── history/
    └── state.json

An Agent is a versioned resource:

kind: Agent
version: "1"
name: starter
description: Answers customer questions from the approved dataset.
connection: default
relations:
  include:
    - main.customers
semantics:
  metrics:
    customer_count:
      expression: count(id)
      relation: main.customers
policies:
  read_only: true
  require_evidence: true
  max_rows: 500
  timeout_seconds: 30
evals:
  - starter_regression

An EvalSuite binds executable expectations to that Agent:

kind: EvalSuite
version: 1
name: starter_regression
agent: starter
environment:
  connection: default
cases:
  - name: customer_count
    messages:
      - role: user
        content: How many customers are there?
    expected:
      result:
        type: scalar
        value: 3

Lifecycle

tabletalk connect
tabletalk discover
tabletalk compile
tabletalk plan
tabletalk eval
tabletalk apply
tabletalk ask AGENT "QUESTION"
tabletalk serve
  • connect creates or tests a project connection without writing secrets into generated artifacts.
  • discover shows visible database metadata and can write a scoped Agent.
  • compile is deterministic and does not invoke a model.
  • plan compares canonical candidate and applied artifacts.
  • eval runs the exact candidate through the real structured runtime.
  • apply requires passing receipts for every required suite and updates all selected Agents atomically.
  • ask and serve use applied artifacts only and expose evidence, SQL, verification, and technical receipts.

Supporting inspection commands are available under agents and connections. Run tabletalk COMMAND --help for exact options. Exit codes distinguish usage errors, configuration failures, eval failures, and runtime failures.

Database configuration

SQLite:

connections:
  default:
    type: sqlite
    database_path: ./data.db
    read_only: true

DuckDB:

connections:
  default:
    type: duckdb
    database_path: ./analytics.duckdb
    read_only: true

Snowflake secrets should come from environment variables, not source files:

connections:
  default:
    type: snowflake
    account: ${SNOWFLAKE_ACCOUNT}
    user: ${SNOWFLAKE_USER}
    password: ${SNOWFLAKE_PASSWORD}
    database: ANALYTICS
    warehouse: COMPUTE_WH
    schema: PUBLIC
    role: TABLETALK_READER

Use a database identity that is independently restricted to read-only access. SQL AST validation is an additional boundary, not a replacement for database permissions.

dbt metadata

Point TableTalk at a dbt project or manifest:

dbt:
  project_dir: ../analytics
  target_dir: target

Compilation incorporates available descriptions, lineage, tests, materializations, tags, groups, and ownership into the canonical artifact. A changed dbt manifest changes the candidate digest and must pass evals again.

Examples and verification

Run the deterministic suite:

uv run pytest -q
uv run ruff check tabletalk
uv run mypy tabletalk

The live Gemma smoke test is opt-in because it needs an authenticated Ollama daemon:

TABLETALK_RUN_LIVE_OLLAMA=1 \
uv run pytest -q -m live_ollama tabletalk/tests/test_live_ollama.py

Security and data handling

  • Query execution is read-only and limited to one parsed query.
  • Agent relation, column, join, row, and timeout policies are enforced before execution.
  • Applied state references immutable artifact and eval-receipt digests.
  • Local invocation history stores metadata and receipts, not raw result rows.
  • Credential-shaped values are redacted from history and HTTP responses.
  • A model or database outage produces a typed failure; no cached prose, alternate provider, or heuristic response is substituted.

License

The current package metadata retains CC BY-NC 4.0 while the repository's ownership and third-party asset audit remains unresolved. See docs/refactor/licensing-audit.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabletalk-0.4.0.tar.gz (280.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabletalk-0.4.0-py3-none-any.whl (124.5 kB view details)

Uploaded Python 3

File details

Details for the file tabletalk-0.4.0.tar.gz.

File metadata

  • Download URL: tabletalk-0.4.0.tar.gz
  • Upload date:
  • Size: 280.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tabletalk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3b3dbedb4fc36297d8f2b19288c722951951b6dae75b1a7bfa7df652ae063b42
MD5 cd867148ed410e75d44b7c1c41822859
BLAKE2b-256 76065ddd1ebf21c2695e07def5cfb01642510221650f85b08fad9b7be2f8f0dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabletalk-0.4.0.tar.gz:

Publisher: publish.yml on wtbates99/tabletalk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tabletalk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: tabletalk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 124.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tabletalk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df2f750a6db6466d49b5eb52950b786e9122d13f9fb83b0160e65e0daf7c9d41
MD5 e00f2ab4d6f134c38877f145811ae3e2
BLAKE2b-256 e611b2c15a1cfea975e7df9e7a49d45d5f126ad4e51d850ee788e1fef3b1f3ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabletalk-0.4.0-py3-none-any.whl:

Publisher: publish.yml on wtbates99/tabletalk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.99

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page