A conversational AI-powered tool that helps generate Software Requirements Specifications (SRS) through natural language interactions. The system uses Google's Gemini AI to conduct intelligent Q&A sessions and automatically create professional SRS documents.
- Conversational Interface: Natural language interaction for requirements gathering
- Multi-Specialist Support: Tailored questioning for different project types
- Voice Input/Output: Speech-to-text and text-to-speech capabilities
- Multi-Language Support: Voice input in English, Hindi, Tamil, and Malayalam
- Dual Interface: Both web-based Streamlit app and REST API
- Document Export: Generate PDF documents of the final SRS
- Real-time Processing: Dynamic question generation based on user responses
The project consists of three main components:
- Streamlit Web App (
app.py) - Interactive web interface - FastAPI REST API (
api.py) - RESTful API for integration - Core Logic (
tool.py) - AI-powered question generation and SRS creation
- Python 3.11+
- Google Gemini API key
- Microphone access (for voice input)
- Internet connection (for speech recognition services)
-
Clone the repository
git clone https://github.com/Kartavya-AI/SRS-Generator cd SRS-Generator -
Install dependencies
pip install -r requirements.txt
-
Additional requirements for Streamlit app
pip install streamlit fpdf gtts streamlit-mic-recorder
-
Download DejaVu font (for PDF generation)
- Download
DejaVuSans.ttfand place it in the project root directory
- Download
-
Build the Docker image
docker build -t srs-generator . -
Run the container
docker run -p 8080:8080 srs-generator
-
Start the Streamlit app
streamlit run app.py
-
Access the application
- Open your browser to
http://localhost:8501
- Open your browser to
-
Using the interface
- Enter your Gemini API key in the sidebar
- Select a specialist type (AI/ML, Android, iOS, etc.)
- Provide initial requirements via text or voice
- Answer the generated questions
- Review and download the final SRS document
-
Start the FastAPI server
uvicorn api:app --host 0.0.0.0 --port 8080
-
API Documentation
- Interactive docs:
http://localhost:8080/docs - ReDoc:
http://localhost:8080/redoc
- Interactive docs:
GET /
GET /healthPOST /transcribe/
Content-Type: multipart/form-data
Parameters:
- audio_file: Audio file (WAV, MP3, etc.)
- language: Language code (en-US, hi-IN, ta-IN, ml-IN)POST /conversation/start
Content-Type: application/json
{
"gemini_api_key": "your-api-key",
"specialist": "AI/ML Specialist",
"requirements": "I want to build a chatbot application"
}POST /conversation/submit_answer
Content-Type: application/json
{
"conversation_id": "uuid-string",
"answer": "User's response to the question"
}GET /conversation/{conversation_id}/status
DELETE /conversation/{conversation_id}The system supports the following specialist types:
- AI/ML Specialist: Machine learning and AI projects
- Android Specialist: Android mobile applications
- iOS Specialist: iOS mobile applications
- Full Stack Web Specialist: Web applications
- Game Development Specialist: Game development projects
- Data Science Specialist: Data analytics and science projects
| Variable | Description | Default |
|---|---|---|
GOOGLE_API_KEY |
Your Gemini API key | Required |
PORT |
Server port | 8080 |
ENVIRONMENT |
Environment name | production |
PYTHONUNBUFFERED |
Python output buffering | 1 |
PYTHONDONTWRITEBYTECODE |
Disable .pyc files | 1 |
The generated SRS follows industry standards with these sections:
-
Introduction
- Purpose of the Document
- Scope of the Project
- Target Audience
-
Overall Description
- Product Perspective
- Product Functions
- User Characteristics
- Constraints
- Assumptions and Dependencies
-
System Features
- Detailed feature descriptions
- Functional requirements
-
Non-Functional Requirements
- Performance
- Security
- Usability
- Reliability
-
Appendices (Optional)
- Definitions and acronyms
- API keys are handled securely and not logged
- Input validation on all endpoints
- CORS properly configured
- User sessions are temporary and cleaned up automatically
- No persistent storage of sensitive data
The system includes comprehensive error handling for:
- Invalid API keys
- Speech recognition failures
- Network connectivity issues
- Malformed requests
- Resource cleanup
- Timeout scenarios
- English (US):
en-US - Hindi (India):
hi-IN - Tamil (India):
ta-IN - Malayalam (India):
ml-IN
- Supports multiple languages for question narration
- Automatic language detection based on user selection
- Question Generation: ~3-5 seconds per session
- SRS Generation: ~5-10 seconds depending on complexity
- Memory Management: Automatic cleanup of old conversations
- Concurrent Users: Supports multiple simultaneous sessions
-
Speech Recognition Not Working
- Check microphone permissions
- Ensure stable internet connection
- Try different audio formats
-
API Key Issues
- Verify Gemini API key format (starts with 'AIza')
- Check API quotas and billing
- Ensure key has necessary permissions
-
PDF Generation Fails
- Ensure
DejaVuSans.ttfis in project directory - Check write permissions
- Verify FPDF installation
- Ensure
-
Docker Build Issues
- Ensure sufficient disk space
- Check Docker daemon is running
- Verify requirements.txt is complete
- Application logs are available through standard Python logging
- Use
LOG_LEVEL=DEBUGfor detailed debugging - API access logs available in FastAPI format
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- v1.0.0: Initial release with core functionality
- Conversational SRS generation
- Multi-language voice support
- REST API and web interface
- Docker containerization
For issues and questions:
- Check the troubleshooting section
- Review API documentation
- Create an issue in the repository
- Contact the development team
- Google Gemini AI for natural language processing
- LangChain for AI orchestration
- FastAPI for the REST API framework
- Streamlit for the web interface
- Contributors and testers
Note: This application requires an active internet connection for AI processing and speech recognition services. Ensure your Gemini API key has sufficient quota for the expected usage.