Warning
Project halted. Development is on hold for private reasons and there is no active support or feature work right now. The code below reflects the last working state.
Klaro is an autonomous AI agent that reads a codebase and writes its documentation for you: README files, API references, and other Markdown docs generated directly from the source rather than hand-written.
Klaro runs a pure-Python ReAct (Reasoning and Acting) loop built on LangChain and LangGraph. Given a project directory, it:
- Walks the file tree and parses each Python file's AST to extract classes, functions, and structure.
- Retrieves relevant context from a ChromaDB vector store seeded with your existing style guides, so the output matches your project's tone and conventions.
- Plans and executes tool calls (
list_files,analyze_code,web_search) in a loop, self-correcting when a step fails. - Writes the resulting documentation to Markdown.
git clone https://github.com/aethrox/klaro.git
cd klaro
python -m venv klaro-env
source klaro-env/bin/activate # klaro-env\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env # add OPENAI_API_KEY
python main.py # analyzes the current directoryRun it against a different project with python main.py /path/to/project. The ChromaDB knowledge base initializes automatically on first run.
| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY |
Yes | - | OpenAI API key for LLM calls and embeddings |
KLARO_RECURSION_LIMIT |
No | 50 |
Maximum agent iterations before timeout |
LANGSMITH_TRACING |
No | false |
Enable LangSmith tracing for debugging |
LANGSMITH_API_KEY |
No | - | LangSmith API key, if tracing is enabled |
Klaro defaults to gpt-4o; change the LLM_MODEL variable in main.py for a cheaper or faster model. See the Configuration Guide for the full variable list and model trade-offs, and the Usage Examples Guide for programmatic usage and integration patterns.
- Code analysis currently covers Python only (via the standard library
astmodule). - Requires an OpenAI API key; there is no offline or local-model mode.
- Multi-format output beyond Markdown, and LangGraph-based model routing to reduce API cost, are planned but not implemented.
- Development is paused, so open issues and PRs may not be reviewed promptly.
MIT, see LICENSE.
