A multi-agent literature review assistant powered by AutoGen. Survey Studio uses AI agents to automatically search arXiv, analyze research papers, and generate comprehensive literature reviews through a clean REST API.
- Multi-Agent System: Two specialized AI agents work together:
- Search Agent π: Crafts optimized arXiv queries and retrieves relevant papers
- Summarizer Agent π: Generates structured literature reviews with key insights
- Multi-Provider AI Support: Intelligent fallback across 4 AI providers:
- Together AI - Cost-effective with generous free tier
- Google Gemini - Fast and capable for complex analysis
- Perplexity - Research-focused with web access
- OpenAI - Reliable fallback with consistent performance
- Cost Optimization: Automatic provider selection based on cost efficiency and availability
- Usage Monitoring: Track API usage, costs, and performance across all providers
- REST API: Clean, well-documented API functions for building custom interfaces
- arXiv Integration: Direct access to the world's largest repository of academic papers
- Configurable: Adjustable number of papers, AI models, and search parameters
- Export Support: Generate Markdown and HTML reports
- Professional Development Setup: Full CI/CD pipeline with linting and type checking
flowchart TD
subgraph API["REST API Layer"]
Client["Client Application"] -->|"HTTP requests"| APIFunctions["API Functions"]
APIFunctions -->|"JSON responses"| Client
end
subgraph Backend["Survey Studio Core"]
Orchestrator["Orchestrator"] --> SearchAgent
Orchestrator --> SummarizerAgent
LLMFactory["LLM Factory"] -->|"intelligent selection"| AIProviders
end
subgraph AIProviders["AI Providers"]
TogetherAI["Together AI<br/>(Primary)"]
Gemini["Google Gemini<br/>(Secondary)"]
Perplexity["Perplexity<br/>(Research)"]
OpenAI["OpenAI<br/>(Fallback)"]
end
SearchAgent["Search Agent"] -->|"queries"| ArXiv[("arXiv API")]
SearchAgent -->|"returns papers"| Orchestrator
SummarizerAgent["Summarizer Agent"] -->|"LLM calls"| LLMFactory
LLMFactory -->|"fallback on failure"| AIProviders
Orchestrator -->|"results"| APIFunctions
- REST API Layer: Provides clean functions for building custom interfaces
- Search Agent: Generates and executes arXiv queries
- Summarizer Agent: Produces structured review using AI models
- LLM Factory: Intelligently selects and manages AI providers with fallback
- Orchestrator: Manages the multi-agent loop and data flow
- Python 3.12.11+
- Poetry (for dependency management)
- At least one AI provider API key
-
Clone the repository:
git clone https://github.com/Aditya-gam/survey-studio.git cd survey-studio -
Install dependencies with Poetry:
poetry install
-
Set up environment variables:
Option A: Using .env file (Recommended for local development):
# Copy the template and add your API key cp .env.example .env # Edit .env and add your actual API key
Option B: Using environment variable:
export OPENAI_API_KEY="your-openai-api-key-here"
Survey Studio provides a comprehensive REST API that enables developers to integrate literature review capabilities into their applications. The API follows modern REST principles and includes complete OpenAPI/Swagger documentation.
Follow this complete workflow to get started with the Survey Studio API:
poetry run devThe server will start on localhost:8000 with hot reload enabled for development.
Check that everything is working correctly:
curl -X GET "localhost:8000/health"Expected Response:
{
"status": "healthy",
"providers": {
"available_count": 1,
"best_provider": "together-ai",
"providers": [
{
"name": "together-ai",
"model": "meta-llama/Llama-3.1-70B-Instruct-Turbo",
"priority": 1,
"free_tier_rpm": 30,
"free_tier_tpm": 200000
}
]
},
"timestamp": "2025-01-20T10:30:45.123456",
"version": "0.1.0"
}Before running a full review, you can validate your parameters:
curl -X POST "localhost:8000/api/v1/validate" \
-H "Content-Type: application/json" \
-d '{
"topic": "retrieval augmented generation",
"num_papers": 5,
"model": "auto"
}'Expected Response:
{
"status": "completed",
"results": {
"valid": true,
"message": "Parameters are valid",
"topic": "retrieval augmented generation",
"num_papers": 5,
"model": "auto"
}
}Execute a complete literature review:
curl -X POST "localhost:8000/api/v1/reviews" \
-H "Content-Type: application/json" \
-d '{
"topic": "retrieval augmented generation",
"num_papers": 5,
"model": "auto"
}'Expected Response:
{
"status": "completed",
"results": [
"# Literature Review: Retrieval Augmented Generation\n\n## Overview\nRetrieval-Augmented Generation (RAG) represents a significant advancement...",
"## Key Findings\n1. RAG systems demonstrate superior performance in knowledge-intensive tasks...",
"## Paper Analysis\n### Paper 1: 'Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks'\n- **Authors**: Lewis et al.\n- **Summary**: This foundational work introduces..."
]
}Generate formatted exports of your review results:
curl -X POST "localhost:8000/api/v1/export" \
-H "Content-Type: application/json" \
-d '{
"topic": "retrieval augmented generation",
"results_frames": [
"# Literature Review: Retrieval Augmented Generation...",
"## Key Findings...",
"## Paper Analysis..."
],
"num_papers": 5,
"model": "auto",
"session_id": "session_12345",
"format_type": "markdown"
}'Expected Response:
{
"content": "# Survey Studio Literature Review\n\n**Topic**: Retrieval Augmented Generation...",
"filename": "literature_review_retrieval_augmented_generation_20250120_103045.md",
"mime_type": "text/markdown",
"format": "markdown",
"metadata": {
"topic": "retrieval augmented generation",
"num_papers": 5,
"model": "auto",
"session_id": "session_12345",
"generated_at": "2025-01-20T10:30:45.123456"
}
}| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Service health check with provider status |
GET |
/ |
Basic service information |
GET |
/providers |
Detailed AI provider configuration |
GET |
/models |
Available AI models by provider |
POST |
/api/v1/validate |
Validate review parameters (optional) |
POST |
/api/v1/reviews |
Execute literature review |
POST |
/api/v1/export |
Export review results to various formats |
{
"topic": "string (1-500 characters)",
"num_papers": "integer (1-50)",
"model": "string ('auto' for automatic selection)"
}{
"topic": "string",
"results_frames": ["array of strings"],
"num_papers": "integer",
"model": "string",
"session_id": "string",
"format_type": "string ('markdown' or 'html', default: 'markdown')"
}For detailed API specifications, request/response schemas, and interactive testing:
Visit: http://localhost:8000/docs (when server is running)
This provides the full OpenAPI/Swagger documentation with:
- Complete endpoint specifications
- Request/response examples
- Interactive API testing interface
- Model schemas and validation rules
To confirm everything is working after setup:
- Server Started Successfully: Look for
INFO: Uvicorn running on http://0.0.0.0:8000 - Health Check Passes:
curl localhost:8000/healthreturns"status": "healthy" - API Documentation Accessible: Visit
http://localhost:8000/docsin your browser
Survey Studio supports multiple AI providers with intelligent fallback and cost optimization:
Supported Providers (in priority order):
- Together AI - Best free tier, cost-effective for general tasks
- Google Gemini - Fast and capable for complex analysis
- Perplexity - Best for research with web access capabilities
- OpenAI - Reliable fallback with consistent performance
Required API Keys (at least one):
TOGETHER_AI_API_KEY- Get from Together AIGEMINI_API_KEY- Get from Google AI StudioPERPLEXITY_API_KEY- Get from PerplexityOPENAI_API_KEY- Get from OpenAI Platform
Optional Model Overrides:
TOGETHER_AI_MODEL- e.g.,meta-llama/Llama-3.1-70B-Instruct-TurboGEMINI_MODEL- e.g.,gemini-2.5-flashorgemini-1.5-proPERPLEXITY_MODEL- e.g.,llama-3.1-sonar-huge-128k-onlineOPENAI_MODEL- e.g.,gpt-4o
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 - -
Clone and install dependencies:
git clone https://github.com/Aditya-gam/survey-studio.git cd survey-studio poetry install -
Install pre-commit hooks:
poetry run pre-commit install
-
No venv activation required (use Poetry runner):
# Prefer prefixing commands with 'poetry run' poetry run <command>
-
Run linting and formatting:
poetry run ruff check . poetry run ruff format .
-
Type checking:
poetry run pyright
-
Pre-commit: run the full code quality pipeline locally:
poetry run pre-commit run --all-files
The project enforces 100% compliance via Ruff, Pyright, detect-secrets, and commit message validation.
- Ruff formatting: opinionated code formatting. Imports sorted with isort profile.
- Ruff linting: rule sets enabled: E,W,F,I,B,C4,UP,N,SIM,TCH,ARG,PIE,PT,RET,SLF,TID,ERA,PL.
- Type checking (Pyright): strict configuration; comprehensive type checking with Microsoft's Pyright.
- Secrets scanning:
detect-secretswith a committed baseline. - Commit messages: Conventional Commits validated by Commitizen.
- Poetry checks: validates project metadata and lock consistency.
survey-studio/
βββ src/
β βββ survey_studio/
β βββ __init__.py # Package initialization
β βββ app.py # Main module (redirects to API)
β βββ api.py # REST API functions
β βββ backend.py # AutoGen multi-agent backend
β βββ config.py # Configuration management
β βββ export.py # Export functionality
β βββ orchestrator.py # Main orchestrator
β βββ validation.py # Input validation
βββ .github/
β βββ workflows/ # CI/CD workflows
βββ pyproject.toml # Poetry configuration
βββ .pre-commit-config.yaml # Pre-commit hooks
βββ .gitignore # Git ignore rules
βββ CHANGELOG.md # Project changelog
βββ README.md # This file
- Backend: AutoGen (multi-agent framework)
- API: FastAPI, Pydantic, Uvicorn
- Data Source: arXiv API
- AI Models: Multiple providers with intelligent fallback
- Development: Poetry, Ruff, Pyright
- CI/CD: Pre-commit hooks, GitHub Actions
This project is licensed under the MIT License - see the LICENSE file for details.
- AutoGen for the multi-agent framework
- FastAPI for the API framework
- arXiv for providing access to academic papers
- OpenAI and other AI providers for the language models
If you have questions or need help:
- Check the documentation
- Search existing issues
- Create a new issue
Survey Studio - Accelerating research through AI-powered literature reviews β¨