Inspiration
I have faced the situation where I open a repository and find the README outdated and missing important architecture diagrams, making it necessary to analyze each file in the repository to understand the code structure. Documentation, with rare exceptions, is rarely updated. I decided to explore whether AI could be used to automatically create documentation and improve the understanding of repository contents.
What it does
DocuGen converts either a ZIP file upload or a Git URL into a fully documented, operational repository that can be explored. The application examines the folder structure, identifies the programming languages and frameworks being used, performs AST analysis, and then leverages OpenAI to create several documents:
- A README file
- An
Architecture.mddocument containing a Mermaid diagram - Documentation for each folder and file
- A clear, structured API reference
The documentation produced by this service is stored, can be searched semantically by users, and can be exported as HTML, PDF, or ZIP files.
The application also allows users to use their own OpenAI API key (or, whenever possible, Anthropic/Ollama/Qwen models) through a BYOK settings page.
How I built it
I created a backend using FastAPI and SQLAlchemy and a frontend using Next.js, along with a provider-agnostic AI layer that allows the same prompt pipeline:
repository → folder → file → API → architecture
to run with OpenAI, Anthropic, or a local Ollama model.
What makes this project interesting is that I used AI to help build an AI tool. I used Claude to plan the architecture, review the code from start to finish, and generate precisely scoped fix-it prompts, which were later executed using Codex.
This loop:
review → prompt → Codex implements → verify
allowed me to move quickly while maintaining accuracy.
Challenges I ran into
The most difficult challenge I faced was not implementing the AI technology itself, but discovering halfway through development that the database models were not defined using SQLAlchemy's declarative method. As a result, the application was not creating database tables, causing the majority of the application endpoints to stop functioning.
Alongside this issue, many other problems appeared:
- Uploads were not creating database records
- Documentation and Architecture fields contained incorrect generated values
- Configuration settings were missing
- The overall system behavior became difficult to understand
Instead of fixing each issue individually, I focused on identifying and solving the underlying causes. After resolving them, I created several integration tests to prevent similar bugs from appearing in the future.
Accomplishments that I'm proud of
I’m proud that DocuGen is not just a theoretical concept — I tested it through its entire lifecycle in a real environment.
The AI generation workflow now fails gracefully without interruptions whenever a provider key has not been configured.
I am also proud of the BYOK implementation, where API keys are encrypted and cannot be retrieved or decrypted through API responses.
What I learned
I learned how powerful it can be to use one AI model to define project specifications and another coding AI model to implement them.
The evaluation process with Claude was able to identify problems that Codex would not have discovered independently, while Codex was able to implement fixes much faster than a human developer could.
What's next for DocuGen — AI Repository Intelligence
Next, I plan to add multi-user authentication, which is currently limited to a single user to maintain the MVP approach.
I also plan to introduce:
- A true vector-based semantic search system using a dedicated embedding store
- Incremental re-analysis instead of complete repository rescans for newly committed changes
- A built-in command interface that allows direct communication with the repository
Built With
- anthropic-api
- axios
- codex
- cryptography
- docker
- fastapi
- framer-motion
- gitpython
- mermaid-js
- nextjs
- ollama
- openai-api
- pydantic
- pytest
- python
- react
- rest-api
- shadcn-ui
- sqlalchemy
- sqlite
- tailwindcss
- tree-sitter
- typescript
- uvicorn
Log in or sign up for Devpost to join the conversation.