AI-Powered Documentation Engineer for Software Teams
DocPilot AI is a production-grade Retrieval-Augmented Generation (RAG) system that automatically understands software repositories, answers codebase questions, generates documentation, detects outdated docs, and assists engineering teams in maintaining accurate technical knowledge.
The project combines Hybrid Search, FAISS, LangGraph Agents, Code Parsing, Knowledge Graphs, and Large Language Models to create an intelligent documentation assistant capable of understanding complex software systems.
- Motivation
- Key Features
- System Architecture
- Tech Stack
- Project Structure
- Development Roadmap
- Example Queries
- Skills Demonstrated
- Resume Description
Software documentation becomes outdated rapidly as repositories evolve. Engineering teams frequently face:
- Missing API documentation
- Stale README files
- Inconsistent architecture diagrams
- Difficult onboarding processes
- Time-consuming codebase exploration
- Lack of documentation reviews during pull requests
DocPilot AI addresses these problems by acting as an autonomous Documentation Engineer.
- Parse entire repositories
- Understand project structure
- Extract classes, functions, and APIs
- Track code relationships
Ask natural language questions about the codebase.
Example query:
How is JWT authentication implemented?
The system retrieves relevant code and documentation before generating an answer with citations.
Automatically generate:
- API documentation
- Function descriptions
- Class documentation
- README sections
- Usage examples
Input:
@app.post("/users")
def create_user():
passGenerated output:
### Create User
POST /users
Creates a new user.
Request Body:
{
"email": "string",
"name": "string"
}Detect inconsistencies between source code and documentation.
| Documentation | Code |
|---|---|
POST /users |
POST /api/v2/users |
Output: Documentation appears outdated.
Automatically analyze pull requests and identify:
- Missing documentation
- Changed API contracts
- Outdated examples
- Required README updates
Build relationships between components:
Controller
└── Service
└── Repository
└── Database
This enables graph-based retrieval beyond simple vector search.
GitHub Repository
│
▼
Repository Ingestion
│
▼
Tree-Sitter Parsing
│
▼
Metadata Extraction
│
▼
Chunking
│
▼
Embeddings
│
▼
FAISS Vector Store
│
▼
Hybrid Retrieval
(BM25 + Vector Search)
│
▼
Cross Encoder Reranker
│
▼
LangGraph Agent
│
▼
Generated Answers
Documentation Updates
| Layer | Technologies |
|---|---|
| Backend | Python, FastAPI |
| RAG Framework | LangChain, LangGraph |
| Retrieval | FAISS, BM25, Reciprocal Rank Fusion, Cross Encoder Reranker |
| Code Analysis | Tree-Sitter |
| Graph Layer | NetworkX, Neo4j (future) |
| Embeddings | OpenAI Embeddings, BGE Large |
| Frontend | Next.js, TypeScript, Tailwind CSS |
| Database | PostgreSQL, Redis |
docpilot-ai/
├── backend/
├── ingestion/
│ ├── github_loader.py
│ └── file_loader.py
├── parsing/
│ ├── tree_sitter_parser.py
│ └── metadata_extractor.py
├── chunking/
│ └── code_chunker.py
├── embeddings/
│ └── embedding_service.py
├── vectorstore/
│ └── faiss_store.py
├── retrieval/
│ ├── bm25.py
│ ├── hybrid_search.py
│ └── reranker.py
├── graph/
│ └── dependency_graph.py
├── agents/
│ ├── retriever_agent.py
│ ├── documentation_agent.py
│ └── reviewer_agent.py
├── api/
│ └── routes.py
├── frontend/
├── evaluations/
├── tests/
└── README.md
Objectives:
- Clone repositories
- Read project files
- Extract metadata
- Convert files into Documents
Deliverable:
Document(
page_content=chunk,
metadata={
"file": "auth.py",
"language": "python"
}
)- Function-level chunking
- Class-level chunking
- Documentation chunking
Avoid naive fixed-length chunks.
Code Chunk → Embedding → L2 Normalization → FAISS IndexFlatIP
Store metadata separately.
- BM25 Search
- Vector Search
- Reciprocal Rank Fusion
Query → BM25 → FAISS → Fusion
Model: bge-reranker-large
Top 20 Retrieval Results → Reranker → Top 5 Results
User Query → Retrieve → Rerank → LLM → Answer
Include source citations.
Generate API, function, and class documentation plus usage examples.
Compare documentation against current source code. Detect:
- Endpoint changes
- Parameter changes
- Renamed functions
- Missing documentation
Extract imports, dependencies, function calls, and module references. Build graph relationships for Graph RAG.
| Agent | Role |
|---|---|
| Retriever Agent | Finds relevant context |
| Documentation Agent | Generates documentation |
| Reviewer Agent | Validates generated output |
| Drift Agent | Detects documentation inconsistencies |
User Query → Retriever → Documentation Agent → Reviewer Agent → Final Output
- GitHub Webhooks
- Incremental Indexing
- Neo4j Graph Database
- CI/CD Integration
- Slack Integration
- Confluence Integration
- Automated PR Comments
- Multi-Repository Support
- Codebase Visualization
- Architecture Diagram Generation
How does authentication work?Which services call PaymentService?Generate documentation for UserController.Find outdated API documentation.Explain the checkout workflow.
- Retrieval-Augmented Generation (RAG)
- LangGraph Agents
- FAISS
- Hybrid Retrieval
- Tree-Sitter
- Graph RAG
- FastAPI
- Next.js
- Information Retrieval
- LLM Engineering
- Software Architecture
- Agentic Workflows
- Production AI Systems
Built a production-grade AI Documentation Engineer that automatically analyzes software repositories, generates technical documentation, detects documentation drift, and answers codebase-related questions. Implemented hybrid retrieval using BM25, FAISS, reranking models, and graph-based code understanding with LangGraph agent workflows for repository intelligence and automated documentation maintenance.