A powerful command-line research assistant built with Ollama Cloud API.
It searches the web, summarizes results using AI, translates the content, and exports it into multiple file formats.
- 🔍 Web search via DuckDuckGo (DDGS)
- 🧩 AI-powered summarization using Ollama Cloud models
- 🌐 Multi-language translation
- 📄 Export to: TXT, MD, DOCX, PDF (RTL supported)
- 🔐 Secure API key validation
- 🗂 Automatic logging system
- 🎯 Interactive CLI menus
Clone the repository:
git clone https://github.com/Mahdi-Haqiqat/AI-Research-Agent.git
cd AI-Research-AgentInstall dependencies:
pip install -r requirements.txt Or install manually:
pip install ollama ddgs questionary python-dotenv httpx python-docx reportlab arabic-reshaper python-bidi Note: If you want to install on mobile read Mobile Installation
- 🐍 Python 3.9+
- 🌐 Internet connection
ollama
ddgs
questionary
python-dotenv
httpx
python-docx
reportlab
arabic-reshaper
python-bidi
Get your API key from: Ollama
Run the program:
python main.py Then:
- Enter an API
- Enter a topic to research
- Choose target language
- Choose output format
Or:
usage: ai-research [-h] [-l LANGUAGE] [-f FORMAT] [-v] [-c OUTPUT_PATH] [topic ...]
🔬 AI Research Agent - Automated research using AI
positional arguments:
topic Topic to research
options:
-h, --help show this help message and exit
-l, --language LANGUAGE Output language (example: persian, english)
-f, --format FORMAT Output format (txt, md, docx, pdf)
-v, --version show program's version number and exit
-c, --change OUTPUT_PATH Change output directory
e.g,:
python main.py Github -l english -f docxThe tool will:
- Search the web
- Summarize the results
- Translate (if needed)
- Generate the output file
- Log execution details
All executions are logged inside the /logs/ directory.
Each topic generates its own log file containing:
- Date & Time
- Topic
- Language
- Output format
- Execution status
- Error details (with full traceback if failure occurs)
English
Persian
French
German
Arabic
Spanish
Italian
Turkish
PDF output supports RTL languages (Persian, Arabic, Turkish).
- PDF generation requires
DejaVuSans.ttfin the project root directory. - Internet connection is required.
- Ollama Cloud models must be accessible in your account.
- Ensure model names in
.envare correct.
search_agent() → Web search
summarize_agent() → AI summarization
translator_agent() → AI translation
writer_agent() → File export
log_agent() → Execution logging
This project is licensed under the MIT License. See the LICENSE file for details.