ochakai

The context your warehouse can’t hold:
how to interpret the numbers.

An AI agent connected to a semantic layer can run aggregate queries with the right definitions and detect that revenue dropped. What no database schema explains is that a seasonal dip happens every August, that ±6% fluctuations are normal noise, or that morning partition lag can easily mimic a business downturn. That domain context lives only in team experience. ochakai is a context layer for data agents: it curates human-verified definitions, golden queries, and interpretation insights, serving them to Claude Code and other data agents over MCP, REST, and CLI.

$ ochakai search "why is revenue down?"
insights/cases/2024-05-revenue-dip   draft
insights/cases/2026-03-flat-revenue  draft
insights/why-revenue-falls           stable

$ ochakai get insights/cases/2024-05-revenue-dip
揺れの範囲である。理由は探さず、行動もしない。
# Within the usual swing. No cause sought,
# no action taken.

1 割半近い減少でも、この店の月次売上がふだん揺れる幅の
1.4 倍でしかない。
# A fall of nearly 15% is only 1.4 times
# this shop's usual monthly swing.

linked from: insights/why-revenue-falls (Insight, unverified)
An excerpt of real output from the public demo (demo.ochak.ai), columns trimmed. The quoted Japanese is verbatim; the English beside it is this page's rendering. The top hit is a diagnosis an agent wrote back, still a draft waiting for a person to verify it.

Same question, different answer once the knowledge is there

What changes when a data agent can read ochakai? Pick a question to see two answers to it side by side, and the one line of knowledge that changed the answer. The answers are excerpts of what Claude actually replied in our eval, translated from the Japanese.

“What was revenue in August 2026?”

Data only ✗ wrong

August 2026 revenue was about $477,912 across all orders, or about $358,975 net of cancellations and returns.

The right figure is $127,148.82. It counts cancelled and in-transit orders as revenue.

+ ochakai knowledge ✓ right

Result: revenue $127,148.82 (completed items, 1,476 orders, USD, pre-tax equivalent)

It used the company’s agreed revenue calculation as written.

The line that changed the answer

Revenue is recognised on delivery. Only items with status = 'Complete' are counted.

A copy of the revenue recognition rule from the finance wiki. Which orders count as revenue is not something you can read off the tables.

Full text: policies/revenue-recognition (Policy)

“What was the return rate in August 2026?”

Data only ✗ wrong

The August 2026 return rate was about 10.5% by item and about 10.4% by order, roughly the same.

The right figure is 28.8%. Its denominator includes orders not yet delivered, and cancellations.

+ ochakai knowledge ✓ right

The August 2026 return rate was about 28.8% (856 returned / denominator 2,973).

It is below the threshold for the per-product review action (45% or more), so no further action is needed.

Beyond the definition, it also found the threshold for whether anything needs doing.

The line that changed the answer

The denominator is the items whose chance to be returned has closed: delivered, or delivered and sent back. Not every item.

The definition of what goes into the return rate’s denominator. An agent wrote it, and a person checked it before it became official knowledge.

Full text: metrics/return-rate (Metric)

“Why did revenue fall in September 2025 from the month before?”

Data only ✗ wrong in 1 of 2 runs

On top of that, the rise in the return rate (10.1% → 11.5%) and the drop in Organic/Email revenue pushed completed revenue down a little further.

It gives plausible causes to a change the size of any ordinary month.

+ ochakai knowledge ✓ right

The September 2025 drop (−10.1% month on month) is (…) within this store’s normal monthly variation, and is not large enough to say revenue statistically “fell”.

Before looking for causes, it checked whether the change was within the usual range.

The line that changed the answer

This store’s monthly revenue swings by around 10% month on month even when nothing happens.

Written down after breaking 43 months of revenue into its parts, to record how much it moves on its own. A 10% drop no longer sends anyone hunting for a cause.

Full text: insights/why-revenue-falls (Insight)

“Revenue grew sharply in March 2026. What went well?”

Data only ✗ wrong

March’s revenue growth (+20.1%) came (…) from broad demand growth, driven mainly by faster new-customer acquisition (orders +20.3%, revenue +27.5%).

Both runs concluded that something good happened in March.

+ ochakai knowledge ✓ right

Most of it is the rebound from February, which had sunk temporarily.

Before looking at March, it checked that February had been unusually low.

The line that changed the answer

Every month that fell beyond the swing was a February.

What past revenue showed about months that fell further than usual. When a month grows, it says to check first whether the month before was too low.

Full text: insights/why-revenue-falls (Insight)

Every answer in full, with its grading, is in examples/demo-eval/results. The scores and how the eval was run are below; to ask the same questions from your own agent, see Try the public demo.

Try the public demo

No signup required. The demo holds 37 concepts about Google’s public thelook_ecommerce dataset, built so an agent can answer one question to the end: revenue fell — why, and what now? (Latest release: v0.31.1.)

go install github.com/na0fu3y/ochakai/cmd/ochakai@latest
ochakai use https://demo.ochak.ai
ochakai search "why is revenue down?"   # Find relevant concepts
ochakai get insights/why-revenue-falls  # The full text, and what links to it

You can also view it in your browser. Run the command below and visit http://127.0.0.1:8098 to explore the review UI:

ochakai ui --url https://demo.ochak.ai
No Go installed? Use a prebuilt binary
# Example for Apple Silicon Mac. For Intel Mac use darwin_amd64, Linux linux_amd64 / linux_arm64,
# Windows windows_amd64.zip (all available on the releases page)
curl -LO https://github.com/na0fu3y/ochakai/releases/download/v0.31.1/ochakai_0.31.1_darwin_arm64.tar.gz
tar xzf ochakai_0.31.1_darwin_arm64.tar.gz
sudo mv ochakai /usr/local/bin/
ochakai use https://demo.ochak.ai
ochakai search "why is revenue down?"

The archive includes the demo knowledge bundle (examples/demo), which you can import into your own environment as initial data.

On claude.ai? Nothing to install

1. In claude.ai, open Settings → Connectors → Add custom connector, and enter https://demo.ochak.ai/mcp as the URL. Leave the OAuth fields empty.

2. In a chat, ask Claude to use ochakai to find out why revenue fell in May 2024. It searches the demo's knowledge, reads it, and answers.

The demo is a sandbox anyone can write to: what you write is recorded as anonymous and erased at the next reset. On Team and Enterprise plans, only an organization owner can add a custom connector.

Using Claude Desktop? One-click MCP setup

1. Download ochakai_0.31.1.mcpb from the releases page.

2. Open the file. Claude Desktop will open the installer with the demo URL pre-filled. Confirm to connect immediately (supported on macOS & Windows).

From claude.ai or your phone, the Claude connector reaches your deployment through a Google Workspace sign-in instead. Which one to choose: the agent connection guide (Japanese).

The same questions: 9 of 18 with BigQuery alone, 18 of 18 with the knowledge

Nine questions, asked twice each of Claude Code (Sonnet 5). Both runs had the same instructions and the same BigQuery; the only difference was that one could read the demo’s 37 concepts over ochakai’s MCP. A separate Claude call graded each answer against a per-question rubric, and numeric truths were computed in BigQuery at run time (2026-09-27).

Correct answers per question, BigQuery alone against BigQuery plus the demo knowledge
QuestionBigQuery
alone
+ demo
knowledge
What was revenue in August 2026?0/22/2
What was the return rate in August 2026?0/22/2
Is revenue up on last month?1/22/2
Why did revenue fall (within the usual swing)?1/22/2
Why did revenue rise the month after an outlier?0/22/2
Why does a past month’s revenue differ from last week?1/22/2
Which category was discounted most?2/22/2
Why are years-old items still in transit?2/22/2
How many days from stocking to sale, on average?2/22/2
Total9/1818/18

Every wrong answer read the warehouse correctly and still missed. BigQuery alone summed revenue over every status (3.8 times the real figure), put all items under the return rate (10.5% where the definition gives 28.8%), and gave a fall within the usual swing a cause. Nothing in the schema says which reading is right; a few of the 37 documents did. Questions the data answers by itself, both runs got right.

It has a price: with the knowledge, twice the tool calls per question (5.5 → 11.4 turns) and twice the cost ($0.20 → $0.42). The questions were chosen by the people who wrote the knowledge, each was asked twice, with one model, graded by Claude. What it shows is that a few curated documents changed the answers to the kind of question they cover — not an accuracy figure for data agents in general. The answers, the grading and how to run it with your own questions are in examples/README.md (Japanese).

Definitions and interpretation context, in a single search

A formula alone isn’t enough for an AI agent to draw accurate conclusions. Agents also need to understand expected baselines, validated SQL queries, business policies, internal definitions, and known data quirks. ochakai indexes these concepts together, providing complete context in one lookup. Non-text assets like PDFs and diagrams are searchable as well.

Metric

The core metric definition and its internal names

Attested Computation

Sanctioned SQL computations (golden queries) and verification methods

Skill

Step-by-step procedures for running analytical tasks

Insight

How to interpret a metric: baselines, seasonality, thresholds, and caveats

Policy

Business rules governing metrics (e.g., revenue recognition, cost allocation)

Glossary Term

Internal domain vocabulary and what terms mean here

BigQuery Dataset

Catalog entry grouping related tables

BigQuery Table

Table lineage, column notes, and known data anomalies

Reference

External reference materials (e.g., enum definitions, schemas, regulatory rules)

These represent the recommended types, and you can easily add custom types to match your business domain. Learn more in the OKF v0.2 spec or browse practical examples in the demo bundle.

Agents discover; humans verify

Data agents uncover new insights and edge cases during real-world tasks. ochakai automatically captures these as Draft concepts in a human review queue. Once approved by a domain expert, they become verified institutional knowledge shared across all agents. Bundled hooks for Claude Code make this recall and write-back loop effortless.

The demo carries two diagnoses of revenue an agent wrote back, both still drafts: May 2024’s −13%, which it judged within the usual swing and proposed nothing for, and March 2026, when booked items rose 17% and revenue did not. Each keeps its BigQuery job ids as receipts and waits for a person to verify it.

The ochakai draft review queue in the web UI, showing proposed concepts with tags, read counts, and Verify/Reject actions.
Drafts with higher real-world query demand are prioritized in the review queue, ensuring high-value knowledge is validated first.

A practical ontology, without enterprise overhead

Connecting data schemas to business meaning is what lets agents make sound, context-aware decisions. ochakai asks for no dedicated ontology type and no forward-deployed engineers (FDEs): concepts link to each other through ordinary Markdown links, and those links are the structure.

In the demo, table concepts play the part of objects, and joins live in each table’s # Joins section and in the Insights about joins that are not obvious. Revenue is split into three Metrics — booked items, completion rate and average item price — and from each you can follow links to the computation that says which one moved, the action it leads to, and where the data runs out. How this maps onto Palantir Foundry’s vocabulary is in glossary/ontology (Japanese).

How ochakai fits into your stack

If all you need is metric definitions served to agents over MCP, semantic layers and data catalogs already do that. ochakai is designed to complement existing tools rather than replace them: user preferences and session history live in memory layers, data models in semantic layers, and human-verified domain insights in ochakai. The data-agent platforms are another matter: Databricks Genie, Snowflake Cortex Agents, BigQuery Conversational Analytics and Hex Threads are finished data agents, and ochakai's own agent (off by default) competes with them head-on, and today loses on features. What it competes on: an answer names the concepts it rests on and whether a person confirmed them, and the knowledge leaves whole as OKF.

ochakai compared with semantic layers, memory layers, data catalogs, and forward-deployed-engineer ontologies
Capability ochakai Semantic layers / warehouse-nativedbt, warehouse-native semantic models Memory layersmem0, Zep, Letta Data catalogsOpenMetadata, DataHub, Atlan FDE ontologiesPalantir-style
Interpretation knowledge Dedicated Insight type. Holds baselines, seasonality, and caveats. Surfaces alongside definitions in search and links back automatically when a metric is read. None. Returns formulas and definitions, but cannot explain whether a resulting number is good, bad, or expected. Limited. Only what an LLM unassistedly extracts per user session. None. Focused on schemas, lineage, and technical ownership. Yes. Encoded manually by consultants into a proprietary platform.
Human review & provenance Domain experts promote drafts to verified. Full audit trail (author, reviewer, timestamp) and revision history on every concept. Yes, governed by standard code review in data repositories. None. Inaccurate recollections persist silently without review. Varies. Stewardship and certification workflows. Yes, maintained manually by onsite consulting engineers.
Maintenance overhead Autonomous discovery by agents; humans only review high-leverage edge cases and approvals. Ongoing modeling effort, incorporated into standard data engineering pipelines. Fully automated. Extracted by LLMs without curation (minimal effort, but unvetted). Automated ingestion via connectors, followed by manual curation. High. Requires dedicated forward-deployed engineers.
Client compatibility Universal. Standard MCP, REST, and CLI support Claude Code, custom agents, and CI pipelines from a single knowledge base. Varies. dbt supports MCP. Broad. SDKs and APIs. Broad. REST APIs. Proprietary. Locked to the vendor platform.
Data portability & lock-in Open Markdown with YAML frontmatter. Plain files stored directly in Git. Full provenance travels with the document, zero vendor lock-in. Repository-backed code (SQL/YAML models). Vendor-proprietary storage format. API export (schema varies by tool). High lock-in. The ontology belongs to the platform.
Direct warehouse access Zero-credential design. Never connects directly to your data warehouse, reducing attack surface. Query execution is handled by the calling agent. Direct access within the warehouse environment. None. Metadata-only ingestion. Direct platform-level warehouse execution.
Self-hosting Fully self-hostable (MIT). Single Go binary + Postgres for ~$10/month on Cloud Run + Cloud SQL (lexical-only search outside GCP). Partial (dbt Core is open source; warehouse-native options are proprietary). Partial (open-source editions available for mem0 and Letta). Yes (OpenMetadata and DataHub are open source). No (proprietary enterprise software).

Deploy & Get Started

ochakai deploys directly into your own Google Cloud project, keeping your data, context, and provenance strictly under your own control.

Data portability is guaranteed: ochakai export retrieves your entire knowledge base in standard OKF format (Markdown with YAML frontmatter), ready to check into Git or migrate to any other tool.

Deploy Deploy Cloud Run + Cloud SQL with Terraform

git clone https://github.com/na0fu3y/ochakai && cd ochakai/deploy/terraform
cp terraform.tfvars.example terraform.tfvars   # project, region, invokers
terraform init
terraform apply    # Cloud SQL creation takes 10–15 minutes
# One-time manual setup: bootstrap the schema (SQL printed by terraform output)
gcloud sql users set-password postgres --instance=ochakai --prompt-for-password
cloud-sql-proxy "$(terraform output -raw sql_connection_name)" --port 55432 &
psql "host=localhost port=55432 dbname=ochakai user=postgres"
# Inside psql, run the SQL output from `terraform output -raw database_bootstrap_sql`

terraform output -raw use_command   # Output the ochakai use command to share with your team
Without Terraform: manual gcloud setup

Excerpted from the Cloud Run deployment guide (Japanese), which covers architecture rationales, complete bootstrap SQL, and alternative setups such as existing Postgres instances or Cloud Storage attachments.

export PROJECT_ID=<your-project>
export REGION=asia-northeast1
gcloud config set project $PROJECT_ID
gcloud services enable run.googleapis.com sqladmin.googleapis.com \
  sql-component.googleapis.com artifactregistry.googleapis.com

# Cloud Run cannot pull from ghcr.io directly, so create a repository that proxies it
gcloud artifacts repositories create ghcr \
  --repository-format=docker \
  --mode=remote-repository \
  --remote-docker-repo=https://ghcr.io \
  --location=$REGION
export VERSION=0.31.1
export IMAGE=$REGION-docker.pkg.dev/$PROJECT_ID/ghcr/na0fu3y/ochakai:$VERSION

# the database (10–15 minutes to create)
gcloud sql instances create ochakai \
  --database-version=POSTGRES_17 \
  --edition=enterprise \
  --tier=db-f1-micro \
  --region=$REGION \
  --storage-size=10 \
  --storage-type=SSD \
  --no-storage-auto-increase \
  --no-backup \
  --database-flags=cloudsql.iam_authentication=on
gcloud sql databases create ochakai --instance=ochakai
export DB_PASSWORD=$(openssl rand -hex 24)
gcloud sql users create ochakai --instance=ochakai --password=$DB_PASSWORD

# the service account. IAM database auth, so no password appears anywhere in the deployment
gcloud iam service-accounts create ochakai-run --display-name="ochakai service"
export SERVICE_ACCOUNT=ochakai-run@$PROJECT_ID.iam.gserviceaccount.com
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member=serviceAccount:$SERVICE_ACCOUNT --role=roles/cloudsql.client
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member=serviceAccount:$SERVICE_ACCOUNT --role=roles/cloudsql.instanceUser
export DB_SA_USER=ochakai-run@$PROJECT_ID.iam
gcloud sql users create $DB_SA_USER --instance=ochakai --type=cloud_iam_service_account

# here, once, cloud-sql-proxy + psql set up the extensions and object grants (full SQL in §3 of the guide)

# deploy, and let your organization invoke it
gcloud run deploy ochakai \
  --image=$IMAGE \
  --region=$REGION \
  --service-account=$SERVICE_ACCOUNT \
  --no-allow-unauthenticated \
  --min-instances=0 --max-instances=1 \
  --cpu=1 --memory=512Mi \
  --add-cloudsql-instances=$PROJECT_ID:$REGION:ochakai \
  --set-env-vars="OCHAKAI_DB_IAM_AUTH=true" \
  --set-env-vars="OCHAKAI_DATABASE_URL=postgres:///ochakai?host=/cloudsql/$PROJECT_ID:$REGION:ochakai&user=$DB_SA_USER"
gcloud run services add-iam-policy-binding ochakai --region=$REGION \
  --member=domain:your-org.example --role=roles/run.invoker

# semantic search (particularly worth it for a Japanese base)
gcloud services enable aiplatform.googleapis.com
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member=serviceAccount:$SERVICE_ACCOUNT --role=roles/aiplatform.user

Ingest Import your initial table metadata

# Project table schemas into draft concepts. ochakai never connects to your warehouse
# Note: --max_rows ensures all columns are captured (default query truncates at 100 rows)
bq query --max_rows=100000 --format=json --nouse_legacy_sql \
  'SELECT table_schema, table_name, column_name, data_type, is_nullable
     FROM `your-project.your_dataset.INFORMATION_SCHEMA.COLUMNS`
    ORDER BY ordinal_position' \
  | ochakai seed - | ochakai import -

Imported table definitions enter the base as drafts. They become actionable knowledge when your team annotates them with interpretation guidance and caveats. To learn more about scoping your initial rollout and structuring documents, see the onboarding guide (Japanese) and docs/en.md for English guidance.

Per-client MCP setup

Claude Code has a built-in shell, so using the CLI directly is recommended (this preserves token budget by not loading MCP schemas into context). To connect via MCP instead:

claude mcp add ochakai -- ochakai mcp-stdio

For Claude Desktop, using the .mcpb bundle is the fastest route. For manual configuration, add this to claude_desktop_config.json (accessible via Settings → Developer → Edit Config):

{
  "mcpServers": {
    "ochakai": { "command": "ochakai", "args": ["mcp-stdio"] }
  }
}

Cursor, VS Code, Windsurf, Cline, Zed, and Gemini CLI follow similar patterns with client-specific configuration keys. See the MCP client guide for troubleshooting and advanced setups. When connecting to Cloud Run, ensure ochakai is available in your PATH and you are logged in via gcloud auth login.