An intelligent research agent that finds academic papers, discovers related works through Connected Papers, and identifies relevant GitHub repositories. Works completely offline with local LLMs - no API keys required!
Get started in 2 minutes - no setup required:
# 1. Install dependencies
pip install -r requirements.txt
# 2. Run immediately with rule-based processing
python main.py "transformer neural networks"- π Multi-source Paper Search: arXiv, Google Scholar integration
- πΈοΈ Connected Papers: Discover related works and paper networks
- π¦ GitHub Discovery: Find code repositories for research papers
- π€ Local LLM Support: Ollama, Transformers, or rule-based processing
- π Privacy-First: Everything runs locally, no data sent to external APIs
- π Structured Output: Clean JSON results with relevance scoring
No configuration needed - works immediately:
python main.py "machine learning"Uses intelligent keyword matching and scoring algorithms.
Best local AI experience:
# 1. Install Ollama from https://ollama.ai
# 2. Pull a model
ollama pull llama2:7b
# 3. Configure the agent
cp .env.example .env
# Edit .env and set: LLM_PROVIDER=ollama
# 4. Run with AI enhancement
python main.py "deep learning"Offline Hugging Face models:
# Configure for Transformers
cp .env.example .env
# Edit .env and set: LLM_PROVIDER=transformers
python main.py "neural networks"# Edit .env and set:
# LLM_PROVIDER=openai
# OPENAI_API_KEY=your_key_here# Basic search
python main.py "attention mechanisms in transformers"
# Interactive mode
python main.py --interactive
# Limit results for faster testing
python main.py "computer vision" --max-papers 5
# Export results to JSON
python main.py "reinforcement learning" --export results.jsonfrom research_agent import ResearchAgent
# Initialize agent (auto-detects configuration)
agent = ResearchAgent()
# Search for papers
results = agent.search("graph neural networks")
# Access results
print(f"Found {len(results['papers'])} papers")
print(f"Found {len(results['related_papers'])} related papers")
print(f"Found {len(results['github_repos'])} GitHub repos")
# Print summary
if results.get('llm_summary'):
print(f"Summary: {results['llm_summary']}")
agent.close()connected-papers/
βββ main.py # CLI interface
βββ research_agent.py # Core agent orchestrator
βββ paper_searcher.py # arXiv/Scholar search
βββ connected_papers.py # Related papers discovery
βββ github_searcher.py # GitHub repository finder
βββ llm_processor.py # Local LLM integration
βββ config.py # Configuration settings
βββ utils.py # Helper functions
βββ requirements.txt # Dependencies
βββ .env.example # Environment template
Copy .env.example to .env and customize:
# LLM Provider: "ollama", "transformers", "rule_based", or "openai"
LLM_PROVIDER=ollama
# Ollama settings (if using Ollama)
OLLAMA_MODEL=llama2:7b
OLLAMA_BASE_URL=http://localhost:11434
# Transformers settings (if using Transformers)
TRANSFORMERS_MODEL=microsoft/DialoGPT-small
# Optional: GitHub token for higher rate limits
GITHUB_TOKEN=your_github_token
# Optional: OpenAI key (if using OpenAI)
OPENAI_API_KEY=your_openai_keyThe agent returns structured JSON with:
{
"query": "transformer neural networks",
"papers": [
{
"title": "Attention Is All You Need",
"authors": ["Vaswani, Ashish", "..."],
"abstract": "...",
"url": "https://arxiv.org/abs/1706.03762",
"published": "2017-06-12",
"relevance_score": 0.95
}
],
"related_papers": [...],
"github_repos": [
{
"name": "pytorch/pytorch",
"description": "Tensors and Dynamic neural networks...",
"url": "https://github.com/pytorch/pytorch",
"stars": 70000,
"relevance_score": 0.88
}
],
"llm_summary": "Found 10 papers on transformer networks..."
}# Check if Ollama is running
ollama list
# Start Ollama service
ollama serve
# Pull a smaller model if needed
ollama pull llama2:7b-chat# Install PyTorch if needed
pip install torch torchvision torchaudio
# Try a smaller model
# Edit .env: TRANSFORMERS_MODEL=distilbert-base-uncased# If getting rate limited, add GitHub token to .env
GITHUB_TOKEN=your_token_here
# For Google Scholar blocks, the agent will fall back to arXiv# Find papers and code for specific topics
python main.py "graph neural networks for drug discovery"
python main.py "attention mechanisms in computer vision"
python main.py "reinforcement learning robotics"
python main.py "natural language processing transformers"
# Academic paper investigation
python main.py "BERT model architecture"
python main.py "GPT transformer decoder"
python main.py "ResNet convolutional networks"from research_agent import ResearchAgent
# Custom configuration
agent = ResearchAgent(max_papers=20, max_repos=10)
# Multiple queries
queries = [
"federated learning privacy",
"quantum machine learning",
"explainable AI methods"
]
for query in queries:
results = agent.search(query)
print(f"Query: {query}")
print(f"Papers: {len(results['papers'])}")
print(f"Repos: {len(results['github_repos'])}")
print("-" * 40)
agent.close()- Query Processing: LLM or rule-based system expands and refines the research query
- Paper Search: Searches arXiv and Google Scholar for relevant papers
- Connected Papers: Uses paper IDs to find related works and citations
- GitHub Search: Searches for repositories using paper titles and keywords
- Relevance Scoring: Ranks results by relevance to the original query
- Summary Generation: LLM provides insights and summary of findings
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes and test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.
- Support for more paper databases (PubMed, IEEE, ACM)
- Citation network visualization
- Paper PDF analysis and extraction
- More local LLM providers (LM Studio, GPT4All)
- Web interface for non-technical users
- Paper recommendation system
- Research trend analysis
- Connected Papers for paper relationship discovery
- arXiv for open access to research papers
- Ollama for local LLM infrastructure
- Hugging Face for transformer models
Ready to explore research? Start with:
python main.py "your research topic here"