GitHub - langchain-ai/openwiki: OpenWiki is a CLI that writes and maintains agent documentation for your codebase.
Key Points
- 1OpenWiki is a command-line interface tool designed to synthesize local knowledge sources and codebase documentation into an agent-readable wiki using the Google Open Knowledge Format.
- 2The system supports two primary modes: "code mode" for repository-specific documentation and "personal mode" for aggregating data from connectors like Gmail, Notion, and various web platforms.
- 3Users can configure the tool with a wide range of LLM providers, manage authentication through interactive CLI commands, and automate documentation updates via CI/CD workflows.
OpenWiki is a command-line interface (CLI) tool designed to autonomously construct and maintain "agent wikis"—structured knowledge bases tailored for either individual personal memory or specific codebase documentation. By ingesting data from various local and remote sources, OpenWiki synthesizes information into the Google Open Knowledge Format (OKF) v0.1, utilizing YAML front matter for metadata and standard Markdown for content.
Core Methodology and Technical Framework
The tool operates primarily in two modes: Code mode, which targets repository documentation, and Personal mode, which aggregates information from external sources like Notion, Gmail, X/Twitter, Web Search, and Hacker News.#### 1. Ingestion and Connector Architecture
OpenWiki employs a modular, tool-based ingestion architecture. For local repository analysis, it generates compact manifests, while remote providers are accessed via OAuth-authenticated connectors. For MCP-compliant providers (e.g., Notion), it leverages the Model Context Protocol to facilitate secure, authenticated data exchange. Data flows through a deterministic pipeline:
- Raw Data Collection: Connectors fetch raw data and store it in .
- Synthesis: Agent-driven processes consume these raw files to generate the final wiki structure in
~/.openwiki/wiki/.
#### 2. LLM Orchestration and Integration
OpenWiki acts as an orchestration layer for Large Language Models (LLMs). It supports a wide array of providers, including OpenAI, Anthropic, Google Gemini (via AI Studio and Vertex AI), AWS Bedrock, and generic OpenAI-compatible endpoints (e.g., LiteLLM, Ollama, LM Studio).
- Configuration: Secrets and environment-specific settings are stored in
~/.openwiki/.env. - Model Routing: For complex providers like Gemini Enterprise, OpenWiki manages the routing of model IDs to the correct API surfaces.
- Reliability: The system integrates LangChain’s retry logic, defaulting to a retry attempt count , though this can be configured via the
OPENWIKI_PROVIDER_RETRY_ATTEMPTSvariable.
#### 3. Agentic Documentation Maintenance
OpenWiki automates the lifecycle of codebase documentation through CI/CD integration. It automatically maintains AGENTS.md and CLAUDE.md files at the root of a repository. To avoid overwriting user-authored content, it utilizes defined markers:
The system only updates the content within these delimiters, ensuring that repository-specific, user-authored briefs stored in openwiki/INSTRUCTIONS.md are respected as the primary scope for the agent.
#### 4. Compatibility and Data Standards
The tool outputs documents conforming to the OKF v0.1 specification. The system requires every non-reserved Markdown concept to include a non-empty type field in its YAML front matter. While it preserves producer-defined extension fields, it reserves index.md and log.md for internal system operations, maintaining a strict separation between concept-level data and operational logs.
#### 5. Telemetry and Privacy
OpenWiki implements a privacy-first telemetry model. Usage data is keyed by a locally generated install_id stored in ~/.openwiki/install-id. All telemetry collection excludes PII, file contents, credentials, and prompts, focusing strictly on command success metrics and configuration choices. The collection mechanism can be fully disabled by setting the environment variable or .