Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Turn Database Docs into Agent-Ready Knowledge (OKF Series, Part 3)

Description and use

The compiler converts LiveSQLBench raw documentation into OKF, producing concept files for tables and business rules that the SQL agent can read like a wiki.

Problem

An AI SQL agent needs more than a schema; it must understand business terms and rules that are documented in disparate formats, which are not directly usable by the agent.

Outcome

The compiler successfully transforms raw documentation into an OKF bundle for all 18 databases, enabling an SQL agent to read and query the knowledge as if browsing a wiki.

Workflow

  • Set up project layout with okf_compiler package and data/bundles folders
  • Create docker-compose.yml to run the LiveSQLBench PostgreSQL image
  • Start the container and verify the disaster_template database tables
  • Implement readers.py to load the three raw files into Python objects
  • Build concept.py to write individual concept files with frontmatter and body
  • Generate tables.py to create a concept file per table
  • Generate rules.py to create a concept file per business rule with links
  • Write indexes.py to produce index files and a log
  • Create cli.py to expose a single compile command
  • Run the compiler on all 18 databases in the benchmark

Evidence

A compiler. A small Python package that reads a database's raw documentation and writes it as an OKF bundle: one concept file per table and per business rule, linked to each other, with an index file in each folder.

Source

The agent reads the bundle the way you'd browse a wiki: the index first, then only the files the question needs.

Source

We ask the same questions twice: once with the bundle, and once with all the raw documentation pasted into the prompt.

Source

  • Record date: 2026-10-03T05:40:50.509Z