# Building Docs for Agents, Not Humans: Inside OpenWiki

## Executive summary

OpenWiki is an open-source Command Line Interface (CLI) designed to automatically generate and maintain repository documentation specifically optimized for consumption by coding agents. Unlike human-centric wikis, OpenWiki structures content into self-contained, highly searchable snippets using the Open Knowledge Format (OKF). It integrates deeply into a codebase via GitHub Actions, ensuring that documentation remains current with every code change while minimizing manual effort.

## Key takeaways

- Built for Agents, Not Humans: OpenWiki's core thesis is that since agents are increasingly writing code, the documentation must be structured for agent retrieval. This means content must consist of self-contained snippets with predictable headings and optimized context window usage, rather than long narrative pages.
- Automatic Maintenance via CI/CD: The CLI facilitates automatic documentation updates by writing a GitHub Actions workflow. This action runs periodically (e.g., daily), checks the Git history, and uses an agent to generate or update the wiki based on code changes, minimizing manual intervention.
- Adoption of Open Knowledge Format (OKF): The system adopts OKF (Google's Open Knowledge Format) by adding a deterministic YAML front matter to every markdown file. This includes fields like `type`, `title`, and `description`, which significantly improves retrieval, filtering, and searching capabilities for agents.
- Performance Gains in Benchmarks: Early evaluations using the DeepSWE benchmark show that OpenWiki usage leads to fewer tool calls, fewer searches, and a significant drop in token consumption for coding agents while maintaining or improving results.

## Technical details

- OpenWiki CLI Setup: Setup is achieved via the CLI: `npm install openWiki` followed by `openwiki init`. The initialization process sets up API keys, configures the model, and writes necessary files, including a GitHub Actions workflow for continuous updates.
- Open Knowledge Format (OKF): OKF mandates a deterministic YAML front matter at the top of every markdown file. Key fields include `type`, `title`, `description`, `resource`, and `tags`. This structure is crucial for advanced retrieval mechanisms.
- Documentation Structure: The generated wiki includes a `quickstart.md` for high-level context, structured directories for specific concepts, an `index.md`, and a critical `log.md` (change log) to track updates for both agents and human review.
- Update Workflow: The update process runs the agent against the Git history, not just the current code snapshot. It fetches commits since the last run, updates the documentation, and creates a Pull Request (PR) for human review/merging.

## Practical implications

- Build engineers can integrate OpenWiki into CI pipelines using GitHub Actions to ensure documentation is always synchronized with the latest code commits, treating documentation as a versioned artifact.
- The use of OKF provides structured metadata that can be leveraged by custom search tools or internal knowledge bases for advanced filtering and retrieval beyond standard markdown parsing.
- Adopting this system shifts documentation maintenance from manual effort to an automated, agent-driven process, significantly reducing technical debt associated with outdated docs.

## Topics

Agentic Workflow, Documentation Generation, CI/CD Integration, Open Knowledge Format (OKF), LLM Agents, DeepSWE Benchmark, OpenWiki GitHub Repository, LangGraph

Source: https://www.youtube.com/watch?v=XNX-1h2K-9U
