AI-powered tool that converts Software Requirements Specification (SRS) documents into comprehensive technical documentation using a multi-agent LangGraph workflow with intelligent parallel processing.
Converting SRS documents into detailed technical documentation is time-consuming and requires deep analysis. This tool automates the process using AI agents to parse requirements and generate structured technical documentation with architecture diagrams, API specifications, and database schemas.
- Multi-format Support - Upload SRS documents in PDF, DOCX, TXT, or Markdown
- Parallel Multi-Agent System - LangGraph supervisor orchestrates 6 worker agents simultaneously using ThreadPoolExecutor
- Comprehensive Analysis - Extracts functional/non-functional requirements, user roles, and use cases
- Technical Documentation - Generates architecture diagrams, API specs, database schemas, UML diagrams, and feature flows with Mermaid.js
- Real-time Progress - Server-Sent Events (SSE) streaming shows detailed progress during document analysis
- Export Options - Download as Markdown or PDF with rendered diagrams via WeasyPrint
- Project Management - In-memory session-based project storage (no database required)
- User Authentication - File-based JWT authentication with Authlib (no PostgreSQL required)
- LangSmith Integration - Optional cost tracking and trace monitoring
- OpenTelemetry Support - Optional local tracing via AI Toolkit
- Backend - FastAPI with SSE streaming, Python 3.10+
- Frontend - Streamlit with multi-page navigation and authentication
- AI Framework - LangGraph with LangChain, OpenAI (gpt-4o-mini default)
- Authentication - Authlib, python-jose (JWT), passlib (Argon2 password hashing)
- Storage - In-memory (session-only), file-based user store (users.json)
- PDF Generation - WeasyPrint
- Diagrams - Mermaid.js
- Observability - LangSmith (optional), OpenTelemetry (optional)
- Python 3.10+
- OpenAI API key
- System dependencies for PDF generation (macOS):
brew install pango gdk-pixbuf libffi
# Navigate to project directory
cd srs-techdoc-agent
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install all dependencies
pip install -r requirements.txt# Copy example environment file
cp .env.example .env
# Edit .env and add your OpenAI API key
nano .env # or use your favorite editorRequired in .env:
OPENAI_API_KEY=sk-your-openai-key-here
SECRET_KEY=your-secret-jwt-key-change-in-productionOptional configurations:
OPENAI_MODEL=gpt-4o-mini
OPENAI_TEMPERATURE=0.3
ACCESS_TOKEN_EXPIRE_MINUTES=30
# LangSmith (optional - for cost tracking)
# LANGSMITH_API_KEY=your_langsmith_key_here
# LANGSMITH_PROJECT=srs-techdoc-agent
# OpenTelemetry (optional - for local tracing)
# ENABLE_OTEL_TRACING=true
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318Terminal 1 - Backend:
source .venv/bin/activate
uvicorn backend.main:app --reload --port 8000Terminal 2 - Frontend:
source .venv/bin/activate
streamlit run frontend/app.py- Frontend: http://localhost:8501
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
On first run, the application creates a default user:
- Username:
admin - Password:
admin123
Change the password after first login for security.
The application uses a supervisor-based parallel processing architecture:
graph TD
START([START])
PARALLEL[PARALLEL WORKERS NODE<br/>ThreadPoolExecutor - 6 Workers]
REQ[Requirements<br/>Parser]
ARCH[Architecture<br/>Designer]
API[API<br/>Spec]
DB[Database<br/>Designer]
UML[UML Diagram<br/>Generator]
FLOW[Features Flow<br/>Analyzer]
COMPILER[COMPILER NODE<br/>Combines All Outputs]
END_NODE([END])
START --> PARALLEL
PARALLEL --> REQ
PARALLEL --> ARCH
PARALLEL --> API
PARALLEL --> DB
PARALLEL --> UML
PARALLEL --> FLOW
REQ --> COMPILER
ARCH --> COMPILER
API --> COMPILER
DB --> COMPILER
UML --> COMPILER
FLOW --> COMPILER
COMPILER --> END_NODE
style PARALLEL fill:#e1f5ff
style COMPILER fill:#f0f0f0
style START fill:#90EE90
style END_NODE fill:#FFB6C1
-
Parallel Workers Node - Executes 6 specialized workers simultaneously using ThreadPoolExecutor:
- Requirements Parser - Extracts functional/non-functional requirements, user roles, use cases
- Architecture Designer - Creates system architecture, tech stack recommendations, deployment diagrams
- API Specification - Designs RESTful API endpoints, authentication flows, request/response schemas
- Database Designer - Generates database schemas, ERD diagrams, table relationships
- UML Diagram Generator - Creates class diagrams, sequence diagrams, component diagrams
- Features Flow Analyzer - Documents feature workflows, user journeys, data flows
-
Compiler Node - Aggregates all worker outputs into a single comprehensive technical documentation
Each worker receives the full SRS content for comprehensive analysis. The supervisor pattern ensures optimal parallel execution with individual LLM clients per worker to avoid rate limiting bottlenecks.
- True Parallel Execution - ThreadPoolExecutor with staggered starts (200ms) prevents simultaneous rate limits
- Session-Only Memory - No checkpointer needed; state persists only during active session
- Rate Limit Management - Increased timeouts (300s) and retries (3) handle large documents
- Progress Tracking - Real-time SSE streaming provides granular progress updates
- Error Handling - Graceful fallbacks and detailed error messages
srs-techdoc-agent/
├── backend/
│ ├── main.py # FastAPI app with SSE endpoints
│ ├── api/
│ │ ├── auth_routes.py # JWT authentication routes
│ │ └── client.py # API client utilities
│ ├── core/
│ │ ├── auth.py # JWT, password hashing
│ │ ├── langgraph_supervisor.py # Supervisor workflow with 6 workers
│ │ ├── langgraph_pipeline.py # Pipeline wrapper
│ │ ├── models.py # Pydantic models
│ │ ├── pdf_generator.py # WeasyPrint PDF generation
│ │ └── srs_loader.py # Multi-format document parsing
│ └── storage/
│ ├── project_store.py # In-memory project storage
│ ├── database.py # SQLAlchemy models (unused)
│ └── users.json # File-based user store
├── frontend/
│ ├── app.py # Streamlit entry point with auth
│ ├── auth.py # Frontend auth utilities
│ ├── sse_client.py # SSE client for progress streaming
│ └── pages/
│ ├── home.py # Document upload and processing
│ └── projects.py # Project management
├── docs/ # Comprehensive documentation
├── requirements.txt # Python dependencies
└── .env.example # Environment template
POST /api/auth/register- Register new userPOST /api/auth/login- Login and get JWT tokenGET /api/auth/me- Get current user info
POST /api/upload- Upload SRS documentGET /api/projects- List all projects (session-only)GET /api/project/{id}- Get project detailsDELETE /api/project/{id}- Delete projectGET /api/stream-progress/{id}- SSE progress streamGET /api/download-markdown/{id}- Download as MarkdownGET /api/download-pdf/{id}- Download as PDF
- Projects and files are stored in-memory during runtime
- Data is cleared when the server restarts
- No database setup required for quick development and testing
- User credentials stored in
backend/storage/users.json - JWT tokens for session management
- Argon2 password hashing for security
- Default user:
admin/admin123
For production deployments, consider migrating to PostgreSQL:
- SQLAlchemy models are already defined in
backend/storage/database.py - Documentation available in
docs/POSTGRESQL_SETUP.md - Enables persistent storage and multi-user isolation
Track costs, debug traces, and monitor performance:
- Sign up at https://smith.langchain.com/
- Get your API key
- Add to
.env:LANGSMITH_API_KEY=lsv2_pt_your_key_here LANGSMITH_PROJECT=srs-techdoc-agent
Features:
- Token usage and cost tracking per request
- Detailed trace visualization for each worker
- Performance metrics and latency analysis
- Evaluation datasets for testing
See docs/LANGSMITH_SETUP.md for full guide.
Local tracing with AI Toolkit trace viewer:
-
Enable in
.env:ENABLE_OTEL_TRACING=true OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
-
Run AI Toolkit trace collector (port 4318)
-
View traces in VS Code AI Toolkit extension
Import Errors
# Ensure virtual environment is activated
source .venv/bin/activate
# Reinstall dependencies
pip install -r requirements.txtPDF Generation Fails
# macOS: Install system dependencies
brew install pango gdk-pixbuf libffi
# Linux:
sudo apt-get install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0Rate Limit Errors
- Reduce document size or split into smaller sections
- Check OpenAI API quota and billing
- Increase
OPENAI_TIMEOUTin supervisor (default: 300s)
Authentication Issues
- Check
SECRET_KEYis set in.env - Verify
users.jsonexists inbackend/storage/ - Default credentials:
admin/admin123
Port Already in Use
# Kill process on port 8000
lsof -ti:8000 | xargs kill -9
# Or use different port
uvicorn backend.main:app --reload --port 8001Comprehensive documentation available in /docs:
ARCHITECTURE_OVERVIEW.md- System design and componentsLANGGRAPH_ARCHITECTURE.md- LangGraph workflow detailsLANGGRAPH_IMPLEMENTATION.md- Implementation guideAUTHENTICATION.md- Auth system overviewLANGSMITH_SETUP.md- Observability setupSSE_STREAMING.md- Real-time progress implementationLARGE_DOCUMENT_HANDLING.md- Document chunking strategiesFEATURES_FLOW_ALGORITHMS.md- Worker agent details
This is a learning project. Feel free to:
- Explore the code and experiment
- Add new worker agents to the supervisor
- Improve prompts for better output quality
- Enhance the UI/UX
- Add database persistence
- Implement file upload limits and validation
Educational project - created to learn LangGraph, multi-agent systems, and AI application development.
Created to learn! 🚀