Turn Database Docs into Agent-Ready Knowledge (OKF Series, Part 3)
Описание и применение
Компилятор преобразует исходные файлы документации LiveSQLBench в формат OKF, создавая концептуальные файлы для таблиц и бизнес‑правил, которые агент SQL может читать как вики.
Задача
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.
Результат
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.
Рабочий процесс
- 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
Доказательства
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.
The agent reads the bundle the way you'd browse a wiki: the index first, then only the files the question needs.
We ask the same questions twice: once with the bundle, and once with all the raw documentation pasted into the prompt.
- Дата записи: 2026-10-03T05:40:50.509Z