A powerful Streamlit application that uses AI agents to analyze PDF documents, generate insights, and provide comprehensive project analysis using CrewAI.
- PDF Upload & Analysis: Upload any PDF and get AI-powered analysis
- Multi-Agent System: Three specialized AI agents working together
- Project Analyst: Identifies risks, strengths, and opportunities
- Resource Search Specialist: Discovers relevant tools and resources
- Code Architect: Designs system architecture and generates code
- Real-time Results: See analysis progress and results in real-time
- File Generation: Automatically generates markdown reports and documentation
- Download Capability: Download all generated files for offline use
Before running this application, make sure you have:
- Python 3.8+ installed on your system
- Git for version control
- GitHub account for hosting the repository
- API Keys for the required services (see Setup section)
# Clone the repository to your local machine
git clone https://github.com/yourusername/pdf-analysis-crewai.git
# Navigate to the project directory
cd pdf-analysis-crewai# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate# Install all required packages
pip install -r requirements.txtCreate a .env file in the root directory with your API keys:
# Required: Your AIML API key for GPT-5 access
AIML_API_KEY=your_aiml_api_key_here
# Optional: GitHub token for enhanced repository search
GITHUB_TOKEN=your_github_token_here
# Optional: Linkup API key for additional search capabilities
LINKUP_API_KEY=your_linkup_api_key_here
# Optional: EXA API key for scientific research
EXA_API_KEY=your_exa_api_key_hereNote: Only AIML_API_KEY is required. Other keys are optional but enhance functionality.
# Make sure your virtual environment is activated
streamlit run streamlit_app.py# Alternative way to run
python -m streamlit run streamlit_app.py# Run with auto-reload for development
streamlit run streamlit_app.py --server.runOnSave trueOnce running, the application will be available at:
- Local: http://localhost:8501
- Network: http://your-ip-address:8501
The app will automatically open in your default web browser.
- Upload PDF: Use the file uploader to select a PDF document
- Start Analysis: Click the "π Start AI Analysis" button
- Wait for Results: Monitor the progress as AI agents analyze your document
- View Results: See the analysis results and generated files
- Check Files: Click "π Check Generated Files" to refresh and see new content
- Download: Download any generated markdown files for offline use
The application creates three main output directories:
project_analysis_output/: Project analysis reports and insightsresource_output/: Resource discovery findings and recommendationscode_output/: System architecture and code generation outputs
-
"No generated files found"
- Click "π Check Generated Files" button
- Wait a few minutes for agents to complete processing
- Check console for any error messages
-
API Key Errors
- Verify your
.envfile is in the root directory - Ensure
AIML_API_KEYis correctly set - Check that the API key is valid and has sufficient credits
- Verify your
-
PDF Reading Errors
- Ensure the PDF is not password-protected
- Try with a different PDF file
- Check if the PDF contains extractable text (not just images)
-
Port Already in Use
- Streamlit will automatically use the next available port
- Check the terminal output for the actual port number
- Check the terminal/console for detailed error messages
- Verify all dependencies are installed correctly
- Ensure your virtual environment is activated
# Initialize git repository
git init
# Add all files to git
git add .
# Make initial commit
git commit -m "Initial commit: PDF Analysis with CrewAI Streamlit app"- Go to GitHub and sign in
- Click the "+" icon in the top right corner
- Select "New repository"
- Name your repository (e.g.,
pdf-analysis-crewai) - Add a description
- Choose public or private
- DO NOT initialize with README, .gitignore, or license (we already have these)
- Click "Create repository"
# Add the remote origin (replace with your repository URL)
git remote add origin https://github.com/yourusername/pdf-analysis-crewai.git
# Push to GitHub
git push -u origin main
# If your default branch is 'master' instead of 'main':
git push -u origin master- Go to your GitHub repository
- Verify all files are uploaded correctly
- Check that the README.md is properly displayed
When you make changes to your code:
# Add all changes
git add .
# Commit changes with a descriptive message
git commit -m "Update: Improved file generation and error handling"
# Push to GitHub
git push origin mainpdf-analysis-crewai/
βββ streamlit_app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .env # Environment variables (create this)
βββ .gitignore # Git ignore file
βββ project_analysis_output/ # Generated project analysis files
βββ resource_output/ # Generated resource discovery files
βββ code_output/ # Generated architecture and code files
To add new AI agents:
- Create a new agent in the
create_agents()function - Define corresponding tasks in
create_tasks() - Update the crew configuration
- Add new output folders if needed
- Edit the task descriptions to change output requirements
- Modify the file reading logic in
safe_read_file() - Update the UI display logic in the main function
- Modify the CSS in the
st.markdown()sections - Update page configuration in
st.set_page_config() - Customize the sidebar and main content layout
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CrewAI: For the powerful multi-agent framework
- Streamlit: For the excellent web application framework
- OpenAI: For the GPT-5 language model
- Community: For contributions and feedback
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with detailed information
- Include error messages and steps to reproduce
Happy PDF Analyzing! πππ€