LLM-powered extraction
Route any provider litellm supports — OpenAI, Anthropic, Gemini, Bedrock, Azure, vLLM, Ollama — through a single interface. Swap models with one flag.
knowledge is a Python SDK that splits any URL or file by heading, sends each section to a large language model, and writes an OKF v0.1 bundle of linked Markdown — versionable, diffable, and ready to serve.
$ knowledge create https://google.github.io/styleguide/pyguide.html ./pyguide
▸ fetching…
▸ splitting… 6 sections
▸ extracting concepts via gpt-4o…
✓ wrote 6 concept filesPowered by trusted, proven technology
Six composable capabilities. No vendor lock-in. No magic. Just a small, sharp tool that does one thing well.
Route any provider litellm supports — OpenAI, Anthropic, Gemini, Bedrock, Azure, vLLM, Ollama — through a single interface. Swap models with one flag.
Output is a real directory: index.md, per-concept Markdown, YAML frontmatter, tag subfolders. Diff, link, search — like documentation should.
Native handling of HTML (<h2>–<h4>) and Markdown (##) headings. One concept per section, ordered and resolvable.
Exponential backoff retries, 50 MiB body cap, charset detection, HTTP error classification — production hygiene built in.
Use the `knowledge` CLI for ad-hoc work, or import the SDK directly. Immutable Pydantic models, predictable behaviour.
Structural checks for link resolution and orphan detection. Curate bundles by removing concepts without rewriting the whole graph.
No schema to maintain. No infra to deploy. The output is plain files you can read, version, and serve — exactly what good docs should be.
Pass a URL or a local HTML/Markdown file. Resilient HTTP client handles redirects, retries, and size limits.
Each <h2>–<h4> (or ##) section becomes a unit. One concept per section — never more, never less.
litellm routes the call to any provider. Each section becomes a structured Pydantic Concept.
A real directory on disk: index.md, per-concept files, YAML frontmatter, tag subfolders. Validated, diffable, ready.
Use the CLI for ad-hoc work, the Python API for production pipelines, or read the output bundle directly — it's plain Markdown.
# Create a bundle from any documentation URL$ knowledge create \ https://google.github.io/styleguide/pyguide.html \ ./pyguide▸ fetching… 1.2 MB, 200 OK▸ splitting by <h2>–<h4> 6 sections▸ extracting via gpt-4o… 6 concepts✓ wrote 6 concept files✓ index.md linked to all concepts# Re-extract after the source changes$ knowledge update \ https://google.github.io/styleguide/pyguide.html \ ./pyguide# Trim a bundle by removing specific concepts$ knowledge remove deprecated-section \ outdated-topic ./pyguide/Requires Python 3.12+. Works on macOS, Linux, and Windows.
65+ tests across SDK, CLI, and serialization layers.
Routes through litellm — OpenAI, Anthropic, Gemini, Bedrock, Ollama, vLLM, and more.
Standardized, directory-based, and diffable in Git.
Just pydantic and litellm. No transitive bloat.
Anywhere documentation lives, knowledge makes it structured.
Convert any docs site into a clean, linked corpus you can drop into a vector store — without scraping artefacts.
Pull an HTML reference into per-section concept files. Diff them in pull requests. Review like real docs.
Turn a long-form blog or knowledge dump into a navigable, searchable bundle. One concept per heading.
Ingest public API references and get back a normalized OKF bundle — ready for a static-site generator.
Convert handbook pages into concept files so they're diffable, reviewable, and auditable over time.
Extract structured concept summaries from long papers or reports. Each section becomes its own file.
One pip install. One CLI command. A directory of structured concepts — version-controlled, diffable, and ready to serve.
MIT licensed · Python 3.12+ · Zero config