An AI-enhanced OSINT (Open Source Intelligence) tool for gathering, analyzing, and reporting on information from various web sources. This tool leverages the power of Perplexity AI to provide deeper insights and more accurate analysis.
This project includes both a command-line interface and a full-featured web application for easier interaction.
- π Web Search: Collect information from multiple sources based on specific queries
- π§ AI-Powered Analysis: Use Perplexity AI for enhanced content analysis
- π Entity Recognition: Identify key people, organizations, and concepts from collected data
- π Connection Analysis: Map relationships between identified entities
- π Pattern Recognition: Identify trends and patterns in the collected data
- π Comprehensive Reporting: Generate structured reports with visualizations and actionable insights
- π€ Data Export: Save results in JSON format with proper serialization using Pydantic
- Python 3.8+
- pip package manager
- Node.js 14+ and npm (for web application)
-
Clone the repository:
git clone https://github.com/AXRoux/OSINT-Assistant.git cd OSINT-Assistant
-
Install dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
cp .env.example .env
-
Edit the
.env
file and add your Perplexity API key:PERPLEXITY_API_KEY=your_api_key_here
Run a search query:
python osint_assistant.py --query "quantum computing advances"
Start the web application:
bash run.sh
or make it executable first:
chmod +x run.sh
./run.sh
run_windows.bat
The web application will automatically:
- Install required dependencies
- Set up the environment file if not present
- Build the React frontend if needed
- Start the Flask server
On Windows, the script will automatically open your browser to http://localhost:5000. On Linux/Mac, you'll need to open your browser and navigate to http://localhost:5000 manually.
Save the results to a file:
python osint_assistant.py --query "quantum computing advances" --save
Specify the number of results to collect:
python osint_assistant.py --query "quantum computing advances" --results 15
Output results as JSON:
python osint_assistant.py --query "quantum computing advances" --json
Override the API key from environment file:
python osint_assistant.py --query "quantum computing advances" --api-key "your-api-key"
Argument | Short | Description |
---|---|---|
--query |
-q |
The search query to investigate |
--results |
-r |
Number of results to collect (default: 10) |
--save |
-s |
Save the collected data to a file |
--api-key |
-k |
Perplexity API key (overrides .env file) |
--json |
-j |
Output results as JSON |
This tool uses the Perplexity AI API for enhanced intelligence gathering and analysis. To use this feature:
- Sign up for an account at Perplexity AI
- Navigate to the API section to generate an API key
- Add the key to your
.env
file or use the--api-key
command line argument
Note: The tool will still function without an API key, but will fall back to simulated data rather than real AI-powered analysis.
The tool uses Pydantic models for data validation and serialization:
SearchResult
: Represents a single search result with title, URL, snippet, etc.ContentAnalysis
: Contains analysis of a specific URL including credibility, entities, and sentimentOSINTReport
: The complete report with all collected data and analyses
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
When contributing to this project, please:
- Ensure code follows PEP 8 style guide for Python code
- Write unit tests for new features
- Update documentation as needed
- Make sure not to commit any API keys or sensitive information
- Verify that all tests pass before submitting a PR
If you encounter this error when running the application:
ModuleNotFoundError: No module named 'dotenv'
There are several ways to fix this issue:
-
Run the diagnostic script (most comprehensive):
fix_windows_dotenv.bat
This script will:
- Diagnose your Python environment
- Try multiple installation methods
- Provide detailed troubleshooting guidance
-
Use the included standalone module: No installation required - we've included a standalone
dotenv.py
file directly in the project folder. This will work even if pip fails. -
Manual installation methods:
pip install python-dotenv
or
python -m pip install python-dotenv
or
pip install --user python-dotenv
-
Administrator privileges: Run Command Prompt as Administrator, then try:
pip install python-dotenv
-
Multiple Python installations: If you have multiple Python versions, specify the version:
py -3.9 -m pip install python-dotenv
When running the application directly with python osint_web_app.py
, the browser may not open automatically. Use run_windows.bat
instead to automatically open the browser with the application.
If you encounter either of these errors when running the application:
ModuleNotFoundError: No module named 'dotenv'
or
AttributeError: module 'dotenv' has no attribute 'dotenv_values'
There are several ways to fix this issue:
-
Run the diagnostic script (recommended):
./fix_linux_dotenv.sh
or if it's not executable:
bash fix_linux_dotenv.sh
This script will:
- Diagnose your Python environment
- Try multiple installation methods
- Check if the installed module has all required functions
- Provide Linux-specific troubleshooting guidance
-
Use the included standalone module: No installation required - we've included a standalone
dotenv.py
file directly in the project folder that implements all necessary functions includingdotenv_values
. -
Manual installation methods:
pip install python-dotenv
or
pip3 install python-dotenv
or
sudo pip install python-dotenv
For general dependency issues, you can also run:
pip install -r requirements.txt
- Never commit your
.env
file with real API keys to GitHub - Always use the
.env.example
file as a template - Consider using GitHub Secrets for CI/CD workflows if adding automation
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and research purposes only. Always ensure you comply with relevant laws and regulations when conducting OSINT research. The authors are not responsible for any misuse of this tool.