1The toolboxwhat each tool is, the overview picture, the catalog's words
One picture first. Context goes in one of three ways, gets reviewed (or not), lives in one catalog, and is used by people and agents.
Swipe sideways to see the whole picture →
The three ways in, up close
- You do
bq updateor the console (Google Cloud web UI) for table and column descriptions;gcloudfor aspect types, aspects on columns and glossary terms; BigQuery views for metric formulas; Markdown pages sent withkcmd push- Sources
- what you and your team know
- Writes
- the table card + pages
- Review
- none: live as soon as it's written verified
- Point it at
- the tables to enrich; docs in a Cloud Storage bucket (we used this); test questions with known-good SQL
- Also offered
- connectors for Drive, Docs, Sheets, Slides, Confluence, Jira, GitHub, SharePoint: seen, not tried
- It does
- drafts pages, scores them on your questions, waits for a person
- Writes
- pages in a context set only
- Review
- a change request, page by page, on screen verified
- You give it
- a folder of your docs (Markdown) + kcmd's local copy of the card
- It does
- runs on your machine and writes an overview into those files;
kcmd pushsends them up - But
- a sample: needed 3 fixes to run; plan to customize it
- Writes
- the card overview + pages
- Review
git diff/ pull request before you push; the push itself skips review verified
The six tools, one job each
- What
- Google's metadata database (part of Dataplex): facts about your data, not the data.
- Holds
- a card per BigQuery table (made automatically), aspects, glossaries, and context sets of pages.
- Format
- its own records (entries and aspects) behind an API, not files. Nothing in the catalog is saved as OKF; kcmd converts when you pull or push. verified
- You use it via
- the console (Google Cloud web UI), gcloud, REST API, the MCP server, kcmd.
- What
- A Google-hosted agent that reads your documents and table, drafts pages, tests them on your questions, and asks a person to approve.
- Writes to
- a context set only: pages + one link to the table.
- Status
- Preview; set up in the console (Google Cloud web UI) only (no API for tasks). verified
- What
- Google's open-source sample enrichment agent (in
GoogleCloudPlatform/knowledge-catalog). Runs on your machine; you can change it. - Writes to
- the table card's overview, through kcmd files.
- Status
- a sample: needed patches to run. verified
- What
- Google's "metadata as code" command-line tool. Copies catalog entries to a local folder and back.
- Converts
- catalog records ↔ OKF Markdown files (
--format okf). It is the Google tool that turns catalog context into OKF and back. verified - Commands
init/pull(down),push(up, no review),mcp(serve the local copy).- Status
- version 0.2.5, on npm. verified
- What
- Plain Markdown files with a YAML header, in folders. Any tool or agent can read them; no Google needed.
- Used for
- keeping context in git, and moving it in and out of the catalog with kcmd.
- Not in KC
- the catalog doesn't store OKF; you get OKF files only by pulling with kcmd. verified
- Status
- open spec v0.3; moved out of Google on 2026-11-18. verified
- What
- Google's endpoint that agents call to search and read the catalog live (and, if you allow it, change it).
- Where
https://dataplex.googleapis.com/mcp, 15 tools, uses the caller's Google login.- Status
- worked with no extra setup. verified
kcmd mcp: runs on your machine, 3 tools, serves the local copy from the last pull. verifiedThe catalog's words
Everything in the catalog is an entry inside an entry group, with aspects attached. Here is how they nest, with real names:
Swipe sideways to see the whole picture →
reference) from Studio's table page to the real table. verified snapshot| Word | Plain meaning | SQL Server analogy |
|---|---|---|
| Entry | One record per data object: a dataset, a table, a page | a row in sys.objects |
| Entry group | A folder of entries. @bigquery is Google's; you can make your own | a schema such as dbo |
| Entry type | What kind of entry it is; decides which aspects are required | the object's class |
| Aspect type | The blueprint for a block of fields | a C# class |
| Aspect | A filled-in block on an entry, or on one column | an instance; an extended property with a schema |
| Entry link | A typed link between two entries: reference, definition, synonym, related | a foreign key between metadata rows |
| Glossary, term | Business words stored as entries and linked to columns | a data dictionary |
| Context set | An entry group of Markdown pages for agents | a schema of curated views |
| Change request | Proposed changes waiting for a different person to approve | a pull request |
📄 In the detailed report: Concepts in plain words has more terms with the same analogies.
2Ways in: three ways to fill the catalogby hand, Knowledge Studio, local agent + files
Each way works on its own. You can also mix them on the same table (part 5). Every way is laid out the same: when to pick it, the steps, where it lands, watch out.
A · By hand
- Describe the table and its columns in BigQuery (
bq updateor the console (Google Cloud web UI)). The card copies them by itself. - Tag columns with an aspect: create an aspect type once (a blueprint), then attach it to columns (
gcloud dataplex aspect-types create,entries update). - Add a glossary of business terms and link them to columns (terms with gcloud; the link in the console (Google Cloud web UI)).
- Make views for metrics, so every agent uses the same formula instead of rewriting it.
- Write pages for rules and playbooks as Markdown files and push them into a context set (way C's tools), linking the key page to the table.
type@path: left of @ = which aspect type, right = where on the card; no path = the whole table. One aspect per type per path; writing again replaces it. Created with gcloud dataplex aspect-types create, attached with gcloud dataplex entries update --update-aspects. A global aspect type worked on a us table. verified lesson 26CREATE TABLE … AS SELECT) drops its column descriptions. Aspects and glossary links don't reach an agent's main lookup (part 4); put what agents need every time in descriptions or a linked page. verifiedWhat we saw (Citi Bike table)
We added each layer one at a time and measured the agent's lookup (characters returned):
A rule only in a column description ("PERSONAL data: aggregate only") was ignored: the agent answered a per-station, per-day age question. With the same rule also in a linked page and a view, it refused and gave the allowed monthly figure. verified (one run, 4 questions) · lesson 26
First three sizes measured with gcloud dataplex context lookup, which adds a ~260-character wrapper to the same text.
📄 In the detailed report: Step 1 shows what a fresh GA4 card holds before any of this (almost nothing). Citi Bike isn't in the report; see lesson 26.
B · Knowledge Studio enrichment
Most team knowledge lives in Drive, Docs, Sheets, Slides, Confluence, Jira and GitHub, not in a storage bucket. Studio's task setup offers a Set up button for each of them. verified
If they work as the screen says, Studio reads your knowledge where it already lives: no export step, and a scheduled run could pick up edits to a Doc or a wiki page. That would make keeping agent context fresh much cheaper. guess
Not tried yet: we don't know what they read, how access is granted, or how they handle permissions. It's the next thing worth testing.
Setting up a Studio task, step by step verified

The folder Studio writes into. A name, an id and a location you can't change later. The default is us-central1; we chose us to match the data. A project Owner still needed the Dataplex Content Editor role to open it. verified

A name, a task id, and optional custom instructions ("in one or two sentences, say what this task should improve"). In run 2 an instruction changed how much Studio wrote, not what kind of thing it wrote. verified

Pick the context set, then the resources to enrich (BigQuery or Lakehouse tables). Knowledge signals are extra sources it reads but doesn't change: Cloud Storage buckets, folders or files, and glossaries. We gave it one table and a bucket of 9 documents. verified

Same page, further down: Google Workspace (Drive, Docs, Sheets, Slides), Atlassian (Confluence, Jira), GitHub (repositories, READMEs) and Microsoft (SharePoint), each with Set up, or one Cloud Storage YAML file for all of them. Seen, not tried. verified (the options)

Evaluation set: questions with known-good SQL, to score the change. Curation set: questions to tune on. Auto-publish off means a person reviews every change. We used 12 questions; auto-publish and self-learning off. verified

A service account reads the sources and writes the context set. Run on demand or on a schedule; email a report after each run. Creating the task took about 4.5 minutes with no progress shown. verified

Run 1 took 29 minutes and 104K tokens and ended as "Needs review", not "Succeeded". Nothing is published yet: a person reviews it (part 3). verified
What we saw (GA4, two runs)
| Run 1 | Run 2 (+ instruction asking for fields, terms, rules) | |
|---|---|---|
| Column description fields · glossary terms · rule objects | 0 · 0 · 0 | 0 · 0 · 0 |
| Columns described in prose | 12 of 24 | 24 of 24 |
| Planted policy facts found, cited | all | 14 of 14 |
| Studio's own test, before → after | 67% → 100% | 50% → 100% |
| Time · tokens (free in Preview) · BigQuery | 29 min · 104K · ~USD 0.41 | 33 min · 108K · ~USD 0.40 |
| Flaws a reviewer had to catch | a page that contradicts itself (83% confidence) | wrong tier for 19 columns (84%); SQL missing |
The instruction changed how much Studio wrote, not what kind. Same inputs gave a 67% and a 50% "before" score, so treat its test as rough. With Studio's pages, an outside agent went from 6/15 to 10–12/15 on our questions, and from 0/3 to 3/3 on held-out policy questions. verified
📄 In the detailed report: Step 3 · run 1 (setup, logs, every proposal, screenshots), Step 7 · run 2, Step 5 · agent test.
C · Local agent + files (kcagent, OKF, kcmd)
- Get a local copy:
kcmd init+pullwrites catalog entries as files. Use--format okffor pages. - Write or generate: kcagent fills in a table's overview from your docs; your own agent or a person writes OKF pages (a page needs the
documentaspect in its header). - Review in git: diffs, pull requests, rollback.
- Publish:
kcmd pushwrites straight to the catalog, no review; or send a change request by API so a second person must approve.
kcmd push skips the catalog's review (anyone with contentEditor can change what agents read) and isn't atomic: a failed page can leave an index pointing at nothing. kcmd's default layout pulls nothing for pages (a 403); use --format okf. kcagent is a sample, not a product. verifiedWhat we saw (GA4)
- kcagent: needed 2 patches to run in a new project, has no retry on a 429 quota error, and two identical runs shared 0 sentences. Its SQL examples were valid 8/8 for the table and invalid 8/8 for the dataset. It wrote a ~5,400-character overview onto the real table card, with nothing in the console (Google Cloud web UI) showing a machine wrote it. verified
- Hand-written playbook pushed with kcmd: published directly, no change request. First push applied 2 of 3 changes until we added the
documentaspect. An agent then read it alongside Studio's pages. verified - Change request by API: created in state NEW; the author got
403 "not authorized to approve their own ChangeRequest", even as project Owner. verified
📄 In the detailed report: Step 2 · kcagent, how kcagent works, Step 4 · OKF and playbooks.
3Review: who checks it before people and agents use itchange requests, git, and the route with no review
Agents act on whatever is in the catalog, so someone should check context before it's published. Each way in has a different gate, and one route has none.
kcmd push, gcloud and bq update write straight to the catalog. We listed the change requests before and after a kcmd push: still only Studio's one request, nothing new. After kcagent's text was pushed, the console (Google Cloud web UI) showed it as the table's overview with an Edit button and no sign a machine wrote it. verifiedSwipe sideways to see the whole picture →
kcmd push. verifiedStudio's review screen, in the Google Cloud web console
A Studio run ends as "Needs review", not "Succeeded". Its pages wait in a change request until a person approves. Auto-publish is off by default; turning it on publishes changes that pass a quality score without a person. verified

Every proposed page, index and link, each with a checkbox: remove some, approve the rest.

Step through "2 of 8" like files in a pull request: raw changes or rendered preview, a confidence score, an edit pencil.

The test score before approval (67% → projected 100% on our 12 questions), then "8 approved, 0 rejected". Pages went live about 2 seconds later.
- What we did: removed one page (
pitfalls, whose SQL contradicted its own text), approved the other 8. Pages went live about 2 seconds after approval. verified - Removing is final and isn't logged as a rejection: the run said "0 rejected". Studio also didn't fix the index pages that still pointed to the removed page. verified
- Who approved: Studio's service account is the author, so the person who ran the task could approve its output. Nothing forced a second reviewer here. verified
- A record you can read by API:
GET …/changeRequests/<id>returns the author, state, approver and every change. verified - The edit pencil on a page: seen, not tried.
Reviewing OKF files in git
With way C, the context is files, so git is the natural review tool.
- Commit before the agent runs. We committed kcagent's inputs first, so
git diffshowed exactly what the agent changed, line by line. verified kcmd push --dry-runis not a preview: it only says whether the files are valid, not what would change.git diffis the real preview. verified- A pull request is the gate: diffs, comments, blame, rollback. But the catalog doesn't know about it: anyone with the
dataplex.contentEditorrole can stillkcmd pusharound it. verified (push skips review) · the PR flow itself: not tried here - Need the catalog to enforce it? Send the files' changes as a change request by API instead of
kcmd push: then a second person must approve in the console (Google Cloud web UI). verified
kcmd push (fast, but the catalog enforces nothing), or change requests (the catalog enforces a two-person rule for API requests). Don't mix them without a rule, because kcmd push silently skips the catalog's review. Our verdict📄 In the detailed report: Step 3 · Studio (every review screen), Step 4 · OKF and kcmd (push vs change request).
4Use it: people, command line, agentspeople in the console or command line; agents live or from files
However the context got in, it's used in four ways: two for people, two for agents. All four read the same published catalog.
| Who | How | Good for | |
|---|---|---|---|
| A person, visually | the console (Google Cloud web UI): Knowledge Catalog search, the table's page (Overview, Schema with a description cell per column, aspects), context sets in Knowledge Studio | reading, checking, editing, approving | verified |
| A person or script, command line | gcloud dataplex entries search, gcloud dataplex entries lookup --view=ALL, gcloud dataplex context lookup, the REST API | checks, scripts, CI, measuring what an agent will get | verified |
| An agent, live | the KC MCP server (below) | agents on Google Cloud that need the current, approved context | verified |
| An agent, from files | OKF files from kcmd pull, read directly or through kcmd mcp (below) | agents outside Google, offline, or with context kept in git | verified |
gcloud. Live: our ADK agent called Google's KC MCP server, got the table card and Studio's pages back, wrote the SQL and answered "2,434 purchases", the same number a hand-written bq query gave. Files: kcmd pull wrote the catalog to local OKF files, and kcmd mcp served them to a LangGraph agent, which got 12 of 15 GA4 questions right. verifiedgcloud dataplex context lookup returns the same text the MCP server's lookup_context gives an agent (plus a ~260-character wrapper). Run it before blaming the agent. verified1 · Live, through the KC MCP server
remember_analyst), 30.8 s. The large lookup stays in the conversation, so the SQL call alone sent ~31,000 input tokens. verified lesson 3The 15 tools. Highlighted = the 3 a question-answering agent needs. Struck = the 7 that change things; leave them out and the agent can't delete anything. verified
lookup_context call brings
Brings: the table card (names, types, descriptions, overview) + every context-set page linked to that table + the dataset's card.Leaves out: custom aspects and glossary links. For those the agent needs
lookup_entry, lookup_entry_links or get_glossary, and an instruction saying when. verifiedWhat we saw: lookups grow with linked pages
The lookup stays in the conversation, so it's re-sent on every later model call. On Citi Bike both versions got all 4 questions right, but the agent used 282K input tokens with Studio's pages vs 171K with the hand-built ones. verified (one run) · lesson 3, lesson 26
2 · As files: kcmd pull → OKF
kcmd mcp, or through your own small MCP server.kcmd pull with --format okf writes them, and kcmd push turns them back into entries. Without --format okf, kcmd uses its own layout, which pulled nothing from our context set (a 403 error that kcmd 0.2.5 treats as fatal). verifiedkcmd init --kb <project>.<location>.<context-set> --format okf --pull gives you this:
bundle/
├ agents.md ← root page (not index.md)
├ assets.md ← index page, next to its folder
├ assets/bigquery/kc-okf-poc-261122/
│ ├ ga4_sample.md
│ └ ga4_sample/events.md ← table page
├ documents.md
├ documents/calculating-core-metrics.md
├ documents/pitfalls.md
└ _links.yaml ← entry links (page → table)
---
type: knowledge-base
x-kcmd:
entryType: …/entryTypes/document
entrySource:
labels: {generator: enrichment_agent, source: knowledge_agent}
aspects:
dataplex-types.global.document:
job: {name: enrichment-agent/enrich-…, runTime: 2026-11-24T19:45:19Z}
---
# Pitfalls that silently produce wrong answers
… cites sources as [1], [2] …
| OKF v0.3 field | In Google's export? |
|---|---|
type (the only required one) | yes |
title, description | no |
generated, verified, sources (trust) | no |
index.md, footnote citations | no: agents.md root, [n] lists |
What we saw: files vs MCP
Same agent, same 15 GA4 questions: schema only 6/15; Studio's pages as files 10/15 and 12/15; through kcmd mcp 12/15 and 12/15. Files and MCP were equally accurate; MCP used about 3× the tokens in one test and 1.25× in the other. Our own OKF MCP server (3 tools: list_pages, get_page, search_pages) reads the catalog live instead of files, because a copy drifts. verified · lesson 5
📄 In the detailed report: Where OKF fits (all the ways an outside agent reads context), Step 5 · agent test. The hosted MCP server is in lesson 3, not the report.
5Choose & combinehow they fit together, and which to use when
They don't depend on each other
| Tool | Needs | Doesn't need |
|---|---|---|
| Studio | the catalog | kcmd, OKF, kcagent |
| KC MCP server | the catalog | Studio, kcmd, OKF |
| kcmd | a Knowledge Catalog: every command names one | Studio |
| kcagent | kcmd (to read and write entries), gcloud login, Gemini on Vertex AI (hard-coded; we patched the model name) | Studio |
| OKF | nothing: it's files | anything from Google |
Why kcmd and OKF exist, and what needs Google
| Your setup | What works |
|---|---|
| You use Google Cloud | The full loop: your sources → kcagent (or your own agent, or Studio) → the catalog → kcmd pull --format okf → OKF files any agent can read. And back with kcmd push. verified |
| No Google Cloud at all | OKF still works: it's just Markdown files, which any agent can read. But kcmd and kcagent don't work as shipped: kcmd always talks to a Knowledge Catalog, and kcagent runs gcloud at start and calls Gemini on Vertex AI verified. So you write OKF yourself, or with your own agent (kcagent's code is a useful pattern to copy). The OKF project ships agent skills okf-generate and okf-consume for this docs (we didn't try them). |
Mixes we actually ran
- Studio pages + a hand-written playbook (way B + way C) in one context set; the agent read both. verified
- kcagent's overview on the table card + Studio's pages beside it (way C + way B) on the same GA4 table. verified
- Studio's pages pulled out as OKF and read by an agent outside Google (way B + files out). verified
- Descriptions and aspects by hand + Studio for pages (way A + way B) on one table: likely the best split, not yet tried on one table. guess
Which to use when
| I want to… | Use | Don't expect |
|---|---|---|
| describe columns, mark sensitive ones | A: BigQuery descriptions + custom aspects | Studio to do it (0 fields in 3 runs) |
| turn team documents into agent pages | B: Studio (or C with kcagent if you must own the code) | structured fields, exact SQL, a flaw-free draft |
| keep context in git, hand-write playbooks | C: OKF files + kcmd push, or a change request | a review on kcmd push; atomic pushes |
| a person approves every change before agents see it | B (Studio's review screen) or a change request by API; limit who holds dataplex.contentEditor so nobody can kcmd push around it | Studio to require a second person; a record of removed pages |
| review AI-written context line by line in git | C: commit first, then git diff and a pull request before kcmd push | kcmd push --dry-run to list the changes |
| check what an agent will see | gcloud dataplex context lookup, or read the table's page in the console (Google Cloud web UI) | custom aspects or glossary links in that lookup |
| a GCP agent that reads current, permission-checked context | Live: KC MCP server with a short tool filter | small token bills: linked pages come with every lookup |
| an agent outside Google or offline | Files: kcmd pull → OKF | freshness between pulls; OKF trust fields |
| a business glossary agents use | A: glossary + links, and tell the agent to call get_glossary; or put meanings in descriptions or pages | lookup_context to include glossary links |
Before you build your own
| If you're building… | Already exists | The real gap |
|---|---|---|
| an OKF viewer | OKF is plain Markdown; any Markdown viewer reads it, and the console (Google Cloud web UI) shows the same pages | Google's export has no titles, descriptions or trust fields to show |
| a local "knowledge catalog engine" | kcmd pull + kcmd mcp, or the hosted KC MCP server | kcmd 0.2.5 rough edges (default layout 403, no atomic push) |
| an app feeding glossaries into the catalog | glossary and entry-link APIs; the MCP server's upsert_entry_link, get_glossary | lookup_context doesn't pass glossary links to agents; not tested from an app |
| a context-writing agent | Studio (hosted, with tests and review) and kcagent (open source) | structured output: neither filled column fields or glossary terms for us |
📄 In the detailed report: Step 6 · Verdict: capability by capability, plus a checklist for comparing with a home-built context agent.
Sources
- This repo (GA4): the detailed report, AGENTS.md (all facts and IDs), kcagent, Studio run 1, OKF and kcmd, agent test, Studio run 2, kcmd MCP probe.
- agent-platform-poc: lesson 3, KC MCP server, lesson 5, own OKF MCP server, lesson 26, context layers (Citi Bike), the agent's tool filter.
Caveats: one or two runs each, one GA4 table (public, obfuscated) and one Citi Bike table. Studio is in Preview and changes week to week.