How salahabdelkhabir/autonomous-research-assistant- works
The product is a streamed, multi-agent research assistant: a user submits a topic through the SPA, the API runs a checkpointed LangGraph workflow, and the UI receives progress and a reviewed, cited report with factorized confidence. The graph preserves the separate search, retrieval, evidence-check, writing, and review stages, plus the provider and retrieval strategy layers. Workflow and module links follow the README and SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: workflow.py LangGraph workflow · llm/factory.py LLM selector · api.py FastAPI · retrieval/factory.py Retriever selector
Components 26
Request interface
- Research SPA
frontend/app.js - FastAPI
app/api.py - Response serializer
app/serialize.py
Research workflow
- LangGraph workflow
graph/workflow.py - Evidence check
graph/nodes/checks.py - Node instrumentation
graph/nodes/instrument.py
Sources and retrieval
- Source search
graph/nodes/search.py - arXiv source
sources/arxiv_source.py - Evidence retrieval
graph/nodes/retrieve.py - Retriever selector
retrieval/factory.py - Dense retrieval
retrieval/dense.py - Sparse retrieval
retrieval/sparse.py - Hybrid retrieval
retrieval/hybrid.py
Agents and models
- Writer graph node
graph/nodes/writer.py - Writer agent
agents/writer.py - Reviewer graph node
graph/nodes/reviewer.py - Reviewer agent
agents/reviewer.py - LLM selector
llm/factory.py - LLM interface
llm/base.py - Gemini provider
llm/gemini.py - Ollama provider
llm/ollama.py - OpenRouter provider
llm/openrouter.py
State and reporting
- Workflow state
graph/state.py - Report schemas
graph/schemas.py - Confidence scoring
graph/confidence.py
Other components
- Researcher
Connections 33
- Researcher → Research SPA: submits topic
README.md - Research SPA → FastAPI: posts query
README.md - FastAPI → LangGraph workflow: streams research
app/api.py - LangGraph workflow → Source search: dispatches
graph/workflow.py - Source search → arXiv source: searches papers
graph/nodes/search.py - LangGraph workflow → Evidence retrieval: dispatches
graph/workflow.py - Evidence retrieval → Retriever selector: selects retriever
graph/nodes/retrieve.py - Retriever selector → Dense retrieval: selects strategy
retrieval/factory.py - Retriever selector → Sparse retrieval: selects strategy
retrieval/factory.py - Retriever selector → Hybrid retrieval: selects strategy
retrieval/factory.py - Hybrid retrieval → Dense retrieval: fuses results
retrieval/hybrid.py - Hybrid retrieval → Sparse retrieval: fuses results
retrieval/hybrid.py - LangGraph workflow → Evidence check: checks evidence
graph/workflow.py - Evidence check → Source search: retries if insufficient
graph/workflow.py - Evidence check → Writer graph node: continues if sufficient
graph/workflow.py - LangGraph workflow → Writer graph node: dispatches
graph/workflow.py - Writer graph node → Writer agent: invokes
graph/nodes/writer.py - Writer agent → LLM selector: gets provider
agents/writer.py - LangGraph workflow → Reviewer graph node: dispatches
graph/workflow.py - Reviewer graph node → Reviewer agent: invokes
graph/nodes/reviewer.py - Reviewer agent → LLM selector: gets provider
agents/reviewer.py - LLM selector → LLM interface: returns provider
llm/factory.py - LLM selector → Gemini provider: selects provider
llm/factory.py - LLM selector → Ollama provider: selects provider
llm/factory.py - LLM selector → OpenRouter provider: selects provider
llm/factory.py - LangGraph workflow → Node instrumentation: wraps graph nodes
graph/nodes/instrument.py - Node instrumentation → Workflow state: records metrics
graph/nodes/instrument.py - LangGraph workflow → Workflow state: initializes state
graph/workflow.py - Workflow state → Report schemas: holds report data
graph/state.py - LangGraph workflow → Confidence scoring: computes final score
graph/workflow.py - Confidence scoring → Workflow state: scores final state
graph/confidence.py - FastAPI → Response serializer: serializes response
app/api.py - FastAPI → Research SPA: streams progress and result
README.md