okf (Python binding)
Python binding of okf-ingest — a unified ingestion tool for
Open Knowledge Format
(OKF) bundles, spec v0.3. Validate a bundle, load it into a portable DuckDB
catalog, and semantically search it.
pip install okf-ingest
okf validate ./bundle
okf ingest ./bundle --db catalog.duckdb
okf embed catalog.duckdb # uses local Ollama nomic-embed-text by default
okf rag catalog.duckdb --query "how is revenue computed?" -k 5
import okf
con, summary = okf.ingest("./bundle", db_path="catalog.duckdb")
okf.embed(con) # pluggable embedder
okf.rag_search(con, "revenue", k=5)
The catalog format is shared with the R binding (okf on CRAN-style install),
so you can ingest/embed in one language and query from the other. See the
project README and docs/ for the
full spec-conformance notes and architecture.