A sophisticated autonomous research assistant - combining multi-step reasoning, domain-aware query enhancement, and intelligent synthesis to deliver comprehensive, evidence-based research reports that go far beyond what any single LLM query or Google search can provide. Powered by local LLM inference with Ollama.
| Traditional Approach | ResearchAgent |
|---|---|
| โ Single query, limited context | โ Multi-step reasoning with 10+ targeted searches |
| โ Generic search terms | โ Domain-aware query enhancement with NLP |
| โ Manual source evaluation | โ Automated relevance scoring and content validation |
| โ Surface-level information | โ Deep synthesis with cross-source validation |
| โ No fact-checking | โ Iterative refinement with gap analysis |
| โ Inconsistent quality | โ Progressive fallback strategies ensure results |
Simple LLM Query: "Which team is better, Dodgers or Giants?"
- Result: Generic response based on training data cutoff
- Limitations: No current data, no specific metrics, no evidence
Google Search: "Dodgers vs Giants"
- Result: Random mix of news articles, opinions, outdated stats
- Limitations: Manual filtering, no synthesis, information overload
ResearchAgent: "Which is the better team this decade, the LA Dodgers or SF Giants?"
- Result: Comprehensive analysis with:
- โ Current statistics from MLB.com, Baseball-Reference, ESPN
- โ Multi-year performance comparison (2015-2024)
- โ Playoff records, World Series wins, division titles
- โ Advanced metrics (WAR, OPS+, ERA+, defensive efficiency)
- โ Expert analysis synthesis from multiple sports journalists
- โ Evidence-based conclusion with supporting data
- Autonomous Planning: Breaks complex questions into 5-10 focused sub-questions
- Progressive Research: Each step builds on previous findings
- Dynamic Adaptation: Adjusts strategy based on intermediate results
- Gap Analysis: Identifies and fills missing information automatically
- Entity Recognition: Uses spaCy to extract organizations, people, dates, locations
- Domain Intelligence: Both automatic detection AND user-selectable domains (Technology, Healthcare, Finance, Legal, Academic, Business, Science, General)
- Domain-Aware Enhancement: Specialized agents enhance queries with domain-specific terminology and research focus
- Query Expansion: NLTK WordNet synonyms + domain-specific keywords
- Contextual Rewriting: Generates 10+ targeted search variations per step
- Multi-Provider Search: Google CSE, DuckDuckGo, Brave Search
- Domain-Specific Targeting:
- Sports โ MLB.com, ESPN, Baseball-Reference, FanGraphs
- Technology โ TechCrunch, Ars Technica, Wired, The Verge
- Business โ Bloomberg, Reuters, WSJ, Forbes
- Science โ Nature, Science.org, NCBI, PubMed
- Progressive Fallback: 5-level search strategy ensures relevant results
- Relevance Scoring: TF-IDF + keyword overlap + entity presence
- Pre-Synthesis Filtering: Removes irrelevant, error, or low-quality content
- Source Credibility: Prioritizes authoritative domain sources
- Content Deduplication: Fuzzy matching prevents redundant information
- Error Detection: Identifies 404s, access denied, corrupted content
- Multi-Source Integration: Combines information from 20+ sources per report
- Conflict Resolution: Identifies and addresses contradictory information
- Evidence Linking: Connects claims to specific sources and data
- Confidence Scoring: Indicates reliability of synthesized conclusions
- Stateful Research: All research artifacts (plan, sources, summaries, reports) are saved to a dedicated project directory.
- Continuous Research: Easily resume and build upon previous research by selecting an existing project.
- Knowledge Base: Over time, your projects become a valuable, queryable knowledge base.
Query: "Compare the offensive performance of the Yankees and Red Sox over the past 5 seasons"
ResearchAgent Approach:
- Planning: Breaks down into batting stats, home runs, OPS, team records
- Enhanced Queries: "Yankees batting average 2019-2024", "Red Sox OPS+ advanced metrics"
- Domain Targeting: Searches Baseball-Reference, FanGraphs, MLB.com
- Synthesis: Comprehensive comparison with specific statistics and trends
Why Better: Gets current, specific data from authoritative sources vs generic LLM knowledge
Query: "Analyze the competitive landscape for electric vehicle manufacturers in 2024"
ResearchAgent Approach:
- Planning: Market share, production volumes, technology advantages, financial performance
- Enhanced Queries: "Tesla Model Y sales Q3 2024", "BYD global market share electric vehicles"
- Domain Targeting: Bloomberg, Reuters, company investor relations, industry reports
- Synthesis: Data-driven competitive analysis with market positioning
Why Better: Current market data and financial metrics vs outdated training data
Query: "What are the latest developments in CRISPR gene editing for cancer treatment?"
ResearchAgent Approach:
- Planning: Recent trials, FDA approvals, success rates, specific cancer types
- Enhanced Queries: "CRISPR CAR-T therapy clinical trials 2024", "FDA approval gene editing cancer"
- Domain Targeting: PubMed, Nature, Science.org, clinical trial databases
- Synthesis: Evidence-based summary of current research status
Why Better: Latest peer-reviewed research vs potentially outdated information
Query: "Should I invest in renewable energy stocks in 2025?"
ResearchAgent Approach:
- Planning: Market trends, policy changes, company performance, growth projections
- Enhanced Queries: "renewable energy stock performance 2024", "IRA tax credits solar wind"
- Domain Targeting: MarketWatch, Yahoo Finance, Morningstar, SEC filings
- Synthesis: Comprehensive investment thesis with risk analysis
Why Better: Current market data and regulatory changes vs generic investment advice
- Multi-Agent System: A team of specialized AI agents (Planner, Data Collector, Report Generator) work together to produce comprehensive research reports. This modular architecture improves the quality of the research and makes the system more scalable and extensible.
- Local LLM: Ollama integration with model selection
- NLP Processing: spaCy (entity recognition) + NLTK (query expansion)
- Relevance Scoring: scikit-learn TF-IDF + custom algorithms
- Content Extraction: newspaper3k + Playwright + BeautifulSoup
- GUI: PyQt5 for a modern, cross-platform user interface.
- Web Solution: FastAPI for the backend API, HTML/CSS/JavaScript for the frontend.
- Fuzzy Matching: fuzzywuzzy for deduplication
- Multi-Provider: Google Custom Search, DuckDuckGo, Brave Search
- Rate Limiting: Intelligent request management
- Error Handling: Robust fallback mechanisms
- Content Validation: Pre-processing quality checks
- Progressive Validation: Content relevance scoring at each step
- Iterative Refinement: Automatic gap detection and filling
- Source Verification: Domain authority and credibility checks
- Synthesis Validation: Evidence-based conclusion requirements
ResearchAgent features a powerful Research Automation Framework that extends beyond traditional research with intelligent command execution, data analysis, and workflow automation. This system provides secure, user-approved automation for complex research tasks.
- Multi-Tier Validation: Commands are classified into Safe, Moderate, and Advanced categories
- User Approval Workflow: Restricted commands require explicit user confirmation
- Sandbox Protection: Automation runs in controlled environment with proper validation
- Command Filtering: Dangerous operations are blocked entirely
- Document Analysis: Extract insights from research files and documents
- Statistical Processing: Generate summaries, word counts, and data metrics
- Content Mining: Search through large document collections
- Pattern Recognition: Identify trends and patterns in research data
Example Commands:
# Analyze document structure and content
find documents/ -name "*.pdf" -exec pdfinfo {} \;
# Extract key statistics from research files
wc -l documents/*.txt | sort -n
# Search for specific topics across documents
grep -r "artificial intelligence" documents/ --include="*.txt"- Chart Generation: Create visual representations of research data
- Trend Analysis: Generate graphs showing patterns over time
- Report Enhancement: Add visual elements to research reports
- Custom Dashboards: Build interactive data presentations
Example Commands:
# Generate word frequency charts
python -c "import matplotlib.pyplot as plt; # chart generation code"
# Create timeline visualizations
gnuplot -c timeline_script.gp research_data.csv
# Build interactive HTML dashboards
pandoc research_report.md -o interactive_dashboard.html- Batch Processing: Process multiple files simultaneously
- Pipeline Execution: Run multi-step research workflows
- Task Scheduling: Automate repetitive research tasks
- Integration Scripts: Connect different research tools
Example Commands:
# Batch convert and process research files
for file in documents/*.pdf; do convert_and_analyze "$file"; done
# Run complete research pipeline
./research_pipeline.sh --input data/ --output reports/
# Generate comprehensive research summaries
python research_summarizer.py --batch --all-topics- Context-Aware Recommendations: Suggestions based on your research topic
- Tool Discovery: Find relevant commands for your specific needs
- Best Practices: Learn optimal automation patterns
- Custom Commands: Generate tailored automation scripts
- Integrated Panel: Automation controls built into the main research interface
- Mode Selection: Choose from Data Analysis, Visualization, Workflow, or Custom modes
- Live Output: Real-time command execution results
- User Approval: Interactive dialogs for restricted commands
- Suggestion System: Get smart automation recommendations
- Browser-Based Interface: Full automation capabilities in the web interface
- Responsive Design: Works on desktop, tablet, and mobile devices
- Progress Tracking: Real-time status updates and execution monitoring
- Suggestion Grid: Visual grid of recommended automation commands
- Click-to-Use: Click any suggestion to auto-populate the command input
๐ฏ KEY PRINCIPLE: Custom commands ALWAYS take priority - if you enter a specific command, it will execute regardless of the selected mode. Modes only matter when no custom command is provided.
- Open ResearchAgent: Launch the desktop application
- Navigate to Automation: Scroll to the "๐ง Research Automation" section
- Enter Your Command: Type the specific command you want to execute
- OR Select a mode for preset functionality (only if no custom command)
- Get Smart Suggestions: Click "๐ก Get Suggestions" for context-aware recommendations
- Suggestions populate based on your research query
- Click any suggestion to auto-fill the command field
- Execute: Click "โ๏ธ Run Automation" to run your command
- Approve if Needed: Confirm any restricted commands in the approval dialog
- Access Web Interface: Navigate to
http://localhost:8000 - Expand Automation: Click the "๐ง Research Automation" collapsible section
- Enter Your Command: Type your specific command in the Command field
- OR Leave empty and select a mode for preset functions
- Get Smart Suggestions: Click "๐ก Get Suggestions" for AI-powered recommendations
- Suggestions appear in a scrollable grid below
- Container auto-scrolls to show suggestions
- Click any suggestion card to populate the command field
- Execute: Click "โ๏ธ Run Automation" and monitor real-time progress
- View Results: Scroll within the automation section to see all output
Mode Priority Logic:
- โ Custom Command Provided: Your command executes (mode ignored)
- โ๏ธ No Custom Command: Mode-specific preset function runs
- ๐ Data Analysis: File counting and analysis
- ๐ Visualization: Data summary generation
- ๐ Workflow: System health checks
- ๐ก Custom: Requires a command (will show error if empty)
# What you want: List documents with details
Command: ls -la documents/
Mode: Any (ignored when custom command provided)
Result: โ
Detailed file listing with permissions, dates, sizes# Step 1: Enter research topic in main query
Query: "What is the best material for 3D printing auto parts?"
# Step 2: Click "๐ก Get Suggestions"
# Results: Smart suggestions like:
# - "find documents -name '*.pdf' | head -20" (FILE DISCOVERY)
# - "grep -r 'material' documents/" (CONTENT SEARCH)
# - "ls -la documents/" (FILE ANALYSIS)
# Step 3: Click any suggestion to auto-populate command field
# Step 4: Click "โ๏ธ Run Automation" to execute# Leave Command field empty
Mode: ๐ Data Analysis
Result: โ
Runs preset file counting analysis
Output: "Found 2079 files matching pattern '*' in documents/"- Custom Commands First: Always enter specific commands for exact control
- Use Suggestions Smartly: Let AI recommend commands based on your research context
- Mode as Fallback: Use modes only when you want preset functionality
- Test on Sample Data: Try commands on test files before important data
- Leverage Scrolling: Use the scrollable container to access all controls and results
- Save Successful Patterns: Keep track of command combinations that work well
- ๐ Literature Review: Automate document analysis and citation extraction
- ๐ Data Research: Process CSV files, generate statistics, create charts
- ๐ Content Mining: Search through large document collections
- ๐ Report Generation: Automate formatting and compilation of research reports
- ๐ Workflow Optimization: Create repeatable research processes
- Review Commands: Always understand what automation commands will do
- Approve Carefully: Be cautious when approving advanced/bash commands
- Backup Data: Keep backups of important research files
- Test Environment: Use test data when trying new automation workflows
- Document Analysis:
analyze_documents()- Extract insights from research files - Data Visualization:
create_visualizations()- Generate charts and graphs - Workflow Automation:
run_workflow()- Execute multi-step processes - Smart Suggestions:
get_research_suggestions()- Context-aware recommendations
- Shell Commands: Direct system command execution with safety controls
- Python Scripts: Run custom analysis scripts with research data
- File Processing: Batch operations on research documents
- Data Export: Generate outputs in multiple formats (CSV, JSON, HTML)
Linux/macOS:
git clone https://github.com/sunkencity999/shell_gpt_researchAgent.git
cd shell_gpt_researchAgent
chmod +x install.sh
./install.shWindows:
git clone https://github.com/sunkencity999/shell_gpt_researchAgent.git
cd shell_gpt_researchAgent
install_windows.batCommand Line:
./launch_sgpt_research.sh
# Enter a research goal, then a project name (e.g., "My_EV_Market_Analysis")
# To continue a project, enter its name when prompted.GUI Application:
# Option 1: Use desktop launcher (Linux)
./sgpt-research-gui
# or double-click sgpt-research-gui.desktop
# Option 2: Direct activation
source venv/bin/activate
python sgptAgent/gui_app.py
# In the GUI, you can type a new project name or select an existing one from the dropdown.Web Application:
# Launch the web service (Linux/macOS)
./launch_web.sh
# or (Windows)
launch_web.bat
# Access the web UI in your browser at http://localhost:8000๐ Enhanced Web Interface Features:
- ๐ Domain-Specific Research: Select from 8+ specialized research domains (Technology, Healthcare, Finance, Legal, Academic, Business, Science, General)
- ๐ฏ Smart Query Enhancement: Domain-aware agents automatically enhance your research queries with relevant terminology and focus areas
- ๐ Complete File Management: Full parity with desktop GUI including:
- ๐ View & Preview: Browse saved reports with live preview
- โฌ๏ธ Download: Export reports in multiple formats
- ๐๏ธ Delete: Securely remove unwanted reports with confirmation
- ๐ Refresh: Real-time file list updates
- โ๏ธ Advanced Settings: Configure LLM parameters, output formats, and research depth
- ๐ Live Progress Tracking: Real-time research progress with detailed status updates
- ๐ Secure Operations: Path validation and permission handling for all file operations
Direct Python:
from sgptAgent.agent import ResearchAgent
agent = ResearchAgent()
report = agent.run(
goal="Analyze the future of autonomous vehicles",
project_name="Autonomous_Vehicles_2025",
audience="investors",
tone="professional",
num_results=15
)Environment Variables:
# Required for enhanced search capabilities
export GOOGLE_API_KEY="your_google_api_key"
export GOOGLE_CSE_ID="your_custom_search_engine_id"
# Optional: OpenAI API for testing
export OPENAI_API_KEY="your_openai_key"Model Selection:
- Supports any Ollama model (llama3, mistral, codellama, etc.)
- Automatic model detection and selection interface
- Optimized for models with 7B+ parameters
- Source Diversity: 15-25 unique sources per report
- Content Relevance: 85%+ relevance score after filtering
- Fact Verification: Cross-source validation for key claims
- Completeness: 90%+ coverage of research sub-questions
- Search Strategy: 5-level progressive fallback ensures results
- Processing Speed: 2-5 minutes for comprehensive reports
- Resource Usage: Optimized for local LLM inference
- Success Rate: 95%+ successful report generation
| Method | Sources | Current Data | Synthesis Quality | Time |
|---|---|---|---|---|
| Simple LLM Query | 0 | โ | Basic | 30 sec |
| Google Search | 1-3 manual | None | 10+ min | |
| ResearchAgent | 15-25 auto | โ | Advanced | 3-5 min |
- No Cloud Dependencies: All LLM processing runs locally via Ollama
- Private Research: Your queries never leave your machine
- Secure Storage: Reports saved locally in git-ignored directory
- API Minimization: Only web search APIs used (no content sent to external LLMs)
- Rate Limiting: Respects website rate limits and robots.txt
- Ethical Scraping: Uses newspaper3k and Playwright responsibly
- Source Attribution: Full citation and source tracking
- Content Respect: Follows fair use guidelines
- Audience Targeting: Tailor reports for executives, researchers, students
- Tone Control: Professional, academic, casual, technical writing styles
- Citation Styles: APA, MLA, Chicago, IEEE formatting
- Output Formats: Markdown, PDF, HTML reports
This powerful feature allows you to extract specific, structured information from the research summaries and present it as a clean Markdown table in your final report. It's the ideal way to get organized, actionable data instead of just narrative text.
How It Works
The research process is now designed to always output structured data as a Markdown table. You control the content of this table using the Structured Data Prompt field in the UI (or the structured_data_prompt argument in the Python API).
Your prompt should clearly define the columns of the table you want. The AI will then read the research summaries and populate the rows based on your instructions.
Best Practices for Prompts
- Be Specific: Clearly name the columns you want.
- Focus on Entities: Ask for specific things (e.g., "artists," "companies," "statistics").
- Keep it Concise: The prompt should be a clear instruction for creating the table.
Example Use Cases
1. Analyzing Musicians
- Research Goal: "Who was the most popular musician in 2024?"
- Structured Data Prompt:
"Create a table of the most popular musicians mentioned. Include columns for 'Artist Name', 'Primary Metric of Popularity (e.g., streams, awards, searches)', and 'Key Achievement'."
2. Comparing Sports Teams
- Research Goal: "Who was the best pitcher in the MLB in 2024?"
- Structured Data Prompt:
"Generate a table of top pitchers. The columns should be 'Pitcher Name', 'Team', 'Key Statistic', and 'Notable Accomplishments in 2024'."
3. Tracking Market Trends
- Research Goal: "What are the leading AI companies to watch?"
- Structured Data Prompt:
"Create a table of leading AI companies. Include columns for 'Company Name', 'Key Technology Area', and 'Recent Funding/Valuation'."
By using a well-crafted prompt, you can transform raw research into a perfectly organized table, ready for analysis or presentation.
- Python API: Full programmatic access to research capabilities
- Plugin Architecture: Extensible search providers and content extractors
- Custom Domains: Add specialized search targeting for niche fields
- Batch Processing: Research multiple queries in parallel
- Search Performance: Track query success rates and source quality
- Content Analysis: Identify trending topics and information gaps
- Source Reliability: Build reputation scores for different domains
- Research Patterns: Analyze effective query strategies
- ๐ฏ Domain Selection: Choose from 8 specialized research domains (Technology, Healthcare, Finance, Legal, Academic, Business, Science, General)
- ๐๏ธ Complete File Management: Added secure file deletion with confirmation dialogs and path validation
- ๐ Advanced Progress Tracking: Real-time metrics including elapsed time, ETA estimation, results counter, and success rates
- ๐ Security Enhancements: Directory traversal protection and secure file operations
- ๐ผ Professional UI: Danger button styling, enhanced file management workflow, and improved user feedback
- ๐ง Multi-Strategy Enhancement: Progressive query enhancement with domain-aware targeting
- ๐ Improved Search Targeting: Domain-specific site targeting for better result quality
- ๐ Smart Fallback Strategies: Multiple levels of query refinement with error handling
- ๐ช Content Validation: Pre-synthesis relevance filtering to ensure quality outputs
ResearchAgent was created by Christopher Bradford.
For questions, support, or collaboration opportunities:
- Email: admin@robotbirdservices.com
- Project: Shell GPT Research Agent
MIT License - See LICENSE for details.
Built with powerful open-source tools:
- Shell-GPT for base system control via LLM
- Ollama for local LLM inference
- spaCy for advanced NLP processing
- NLTK for linguistic analysis
- scikit-learn for relevance scoring
- Rich for beautiful CLI interfaces
๐ฌ ResearchAgent: Where AI Meets Deep Research
Transform any question into a comprehensive, evidence-based research report
Get Started โข Examples โข Documentation