How ishan-debugg/research-agent works
Research Copilot turns a topic query into ranked, structured paper research and an inter-paper knowledge graph. The backend coordinates retrieval, reranking, PDF parsing, extraction, and synthesis; the frontend streams progress and presents results, benchmarks, graph, history, and optional tech-stack matching. README documents the main pipeline and capabilities; sampled source confirms orchestration, SSE consumption, graph synthesis, and caching, but not every service’s internal calls.
Main entry points: main.py FastAPI orchestrator · ResearchContext.js Research state · page.js Paper results · cache_service.py Cache service
Components 26
Research interface
- Search input
frontend/app/search/page.js - Research state
frontend/context/ResearchContext.js - Live progress
frontend/app/processing/page.js - Paper results
frontend/app/results/page.js - Benchmark table
frontend/components/BenchmarkExtracted.js - Knowledge graph view
frontend/components/GraphView.js - Paper summary panel
frontend/components/PaperPanel.js - Search history
frontend/app/history/page.js - Profile and theme
frontend/context/UserProfileContext.js
Research pipeline
- FastAPI orchestrator
backend/app/main.py - Pipeline schemas
backend/app/models/schemas.py - Paper retrieval
backend/app/services/arxiv_service.py - Semantic reranking
backend/app/services/rerank_service.py - PDF text extraction
backend/app/services/pdf_service.py - Structured extraction
backend/app/services/extraction_service.py - Graph synthesis
backend/app/services/graph_service.py - Tech-stack matching
backend/app/services/techmatch_service.py
Model integrations
- Groq client
backend/app/services/groq_client.py - Gemini client
backend/app/services/gemini_client.py
Persistence
- History storage
frontend/lib/historyStore.js - Cache service
backend/app/services/cache_service.py - SQLite cache
Other components
- Researcher
- arXiv
- Groq API
- Gemini API
Connections 33
- Researcher → Search input: enters query
- Search input → Research state: starts search
- Research state → FastAPI orchestrator: streams request
- FastAPI orchestrator → Paper retrieval: retrieves candidates
- Paper retrieval → arXiv: queries
- FastAPI orchestrator → Semantic reranking: reranks candidates
- FastAPI orchestrator → PDF text extraction: extracts paper text
- FastAPI orchestrator → Structured extraction: extracts structure
- FastAPI orchestrator → Graph synthesis: synthesizes graph
- FastAPI orchestrator → Research state: streams progress and results
- Research state → Live progress: provides live state
- Live progress → Paper results: navigates on completion
- Paper results → Research state: reads results
- Paper results → Benchmark table: renders metrics
- Paper results → Profile and theme: reads tech stack
- Paper results → FastAPI orchestrator: requests tech match
- FastAPI orchestrator → Tech-stack matching: matches papers
- Knowledge graph view → Research state: reads graph data
- Paper summary panel → Knowledge graph view: shows selected paper
- Search history → History storage: reads entries
- Research state → History storage: saves completed search
- FastAPI orchestrator → Pipeline schemas: validates pipeline data
- Structured extraction → Groq client: requests extraction
- Structured extraction → Gemini client: uses fallback
- Graph synthesis → Groq client: requests synthesis
- Graph synthesis → Gemini client: uses fallback
- Groq client → Groq API: sends model request
- Gemini client → Gemini API: sends model request
- Structured extraction → Cache service: reads and writes extraction cache
- Graph synthesis → Cache service: reads and writes graph cache
- PDF text extraction → Cache service: caches paper text
- FastAPI orchestrator → Cache service: reads and writes query results
- Cache service → SQLite cache: persists cache data