Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

29 Commits

Repository files navigation

DevDocxAI 🤖📄

DevDocxAi is a production-grade multi-agent LangGraph system that automatically generates and updates engineering documentation from your GitHub codebase.

PythonFastAPILangGraphPostgreSQLLicenseStatus


🚨 The Problem

Every engineering team has the same dirty secret — the docs are lying.

Not intentionally. Code moves fast, documentation doesn't.

  • New dev joins → 2 weeks reading outdated wikis
  • Senior engineers constantly interrupted with "what does this do?"
  • PR gets merged → docs never updated
  • Generic RAG chatbots don't understand code structure

DevDocAI fixes this.


✨ What It Does

  • 🔍 Connects to your GitHub repo via OAuth
  • 🌳 Parses your codebase at the AST level — understands functions, classes, modules
  • 📝 Auto-generates structured documentation per module and function
  • 🔄 Updates docs on every PR merge via GitHub webhooks
  • 👀 Human-in-the-Loop review — you approve before anything goes live
  • 💬 Onboarding chatbot — new devs ask questions, get answers from live code

🤖 Agent Pipeline

START
↓
codebase_parser ← AST-level parsing of GitHub repo
↓
doc_generator ← LLM generates structured docs per module/function
↓
brave_researcher ← enriches with external context (libraries, best practices)
↓
HITL checkpoint ← dev reviews generated docs before publish
↓
doc_publisher ← saves to DB + updates vector store
↓
pr_watcher ← GitHub webhook re-triggers on every PR merge
↓
END
Parallel → onboarding_chatbot ← RAG over vector store for new devs

🏗️ Tech Stack

LayerTechnology
Agent FrameworkLangGraph (multi-agent, HITL, checkpointing)
BackendFastAPI + Python 3.12
FrontendNext.js + Tailwind CSS
LLMGroq — llama-3.3-70b-versatile
EmbeddingsCohere embed-english-v3.0
Vector DBQdrant
DatabasePostgreSQL (Neon prod / Docker dev)
CacheRedis (Upstash)
StorageAWS S3
Web SearchBrave Search API
ObservabilityLangSmith
Tool ProtocolMCP (Model Context Protocol)
AuthJWT + GitHub OAuth
Package Manageruv
DeploymentAWS ECR + ECS Fargate
CI/CDGitHub Actions

📁 Project Structure

devdocai/
├── backend/
│ ├── auth/
│ │ ├── jwt.py ← JWT create/verify
│ │ ├── github_oauth.py ← GitHub OAuth flow
│ │ └── routes.py ← HTTP layer only
│ ├── db/
│ │ ├── database.py ← async PostgreSQL engine
│ │ └── models.py ← SQLAlchemy ORM models
│ ├── repositories/
│ │ └── user_repository.py ← all DB queries isolated here
│ ├── schemas/
│ │ └── auth_schemas.py ← Pydantic v2 request/response models
│ ├── services/
│ │ └── auth_service.py ← business logic layer
│ ├── utils/
│ │ ├── helper_auth.py ← bcrypt password helpers
│ │ └── encryption.py ← Fernet encryption for tokens
│ ├── mcp/
│ │ └── github_server.py ← GitHub tools for LangGraph agents
│ ├── agents/
│ │ ├── codebase_parser.py
│ │ ├── doc_generator.py
│ │ ├── brave_researcher.py
│ │ ├── doc_publisher.py
│ │ └── onboarding_chatbot.py
│ ├── graph/
│ │ ├── state.py
│ │ ├── pipeline.py
│ │ └── hitl.py
│ ├── webhooks/
│ │ └── github_pr.py ← PR merge webhook handler
│ ├── cache/
│ │ └── redis_client.py ← Upstash Redis caching
│ ├── vectorstore/
│ │ ├── embeddings.py
│ │ └── qdrant_store.py
│ ├── config.py ← all env vars, pydantic-settings
│ └── main.py ← FastAPI app entry point
├── frontend/ ← Phase 6
│ ├── app/
│ │ ├── dashboard/
│ │ ├── review/ ← HITL review panel
│ │ └── chat/ ← onboarding chatbot UI
└── .github/
└── workflows/
└── deploy.yml ← Phase 7

🏛️ Architecture

Clean layered architecture — every layer has one job:

Route → HTTP only (request / response)
↓
Service → Business logic
↓
Repository → DB queries only
↓
Database

🚀 Getting Started

Prerequisites

  • Python 3.12+
  • uv — fast Python package manager just like pip
  • Docker (for local PostgreSQL)
  • A GitHub OAuth App (create one here)

1. Clone the repo

git clone https://github.com/Nevin100/DevDocxAI.git
cd DevDocxAI/backend

2. Install dependencies

uv venv
# Windows
.venv\Scripts\activate
# Mac/Linuxsource .venv/bin/activate
uv add -r requirements.txt

3. Setup environment variables

cp .env.example .env
# Fill in your actual values in .env

Generate required keys:

# JWT Secret
python -c "import secrets; print(secrets.token_hex(32))"# Fernet Encryption Key
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

4. Start local PostgreSQL (Docker)

docker run -d \
--name devdocai_postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=devpassword \
-e POSTGRES_DB=devdocai \
-p 5432:5432 \
-v devdocai_pgdata:/var/lib/postgresql/data \
postgres:16

5. Run the server

# Windows
.venv\Scripts\python.exe -m uvicorn main:app --reload
# Mac/Linux
uvicorn main:app --reload

6. Open Swagger UI

http://localhost:8000/docs

🔑 Environment Variables

VariableRequired NowDescription
DATABASE_URLPostgreSQL connection string with +asyncpg
JWT_SECRET_KEYRandom secret for JWT signing
ENCRYPTION_KEYFernet key for token encryption
GROQ_API_KEYFrom console.groq.com
LANGCHAIN_API_KEYFrom smith.langchain.com
GITHUB_CLIENT_IDGitHub OAuth App
GITHUB_CLIENT_SECRETGitHub OAuth App
COHERE_API_KEYFrom cohere.com
BRAVE_SEARCH_API_KEYFrom brave.com/search/api
REDIS_URLUpstash Redis URL
AWS_ACCESS_KEY_ID⏳ Phase 7S3 storage

📊 Database Schema

User
└── Repository
├── Document (DocStatus: PENDING → APPROVED → PUBLISHED)
└── PipelineRun (trigger: manual | pr_merge | webhook)

🛣️ Roadmap

PhaseWhatStatus
Phase 1Backend Foundation (FastAPI, DB, Auth, JWT)✅ Complete
Phase 2GitHub OAuth + MCP Server✅ Complete
Phase 3LangGraph Core (State, Pipeline, HITL)✅ Complete
Phase 4Agents (Parser, Generator, Researcher, Chatbot)✅ Complete
Phase 5Webhooks + Redis Cache✅ Complete
Phase 6Next.js Frontend🔨 In Progress
Phase 7Docker + ECR/ECS Fargate + CI/CD🔜 Soon

📖 Blog Series

Following the build in public on dev.to:


🤝 Contributing

This project is under active development. Feel free to open issues or PRs.


Built by Nevin Bali
Building in public 🚀

About

DevDocxAI is a production-grade multi-agent AI system that automatically generates, maintains, and updates engineering documentation by deeply understanding you…DevDocAI is a production-grade multi-agent AI system that automatically generates, maintains, and updates doc. by understanding deeply.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages