How mayeraasingh/scholarlens works
ScholarLens analyzes research-paper PDFs and produces structured JSON and Markdown reports. The principal workflow is CLI or API submission, document extraction, specialized analyses, report aggregation, and session-backed retrieval. The graph preserves the documented analysis stages plus evaluation, code execution, chunking, formatting, and observability. Several source excerpts are partial; documented workflow links are cited to the README, while uncertain internal wiring is omitted.
Main entry points: orchestrator.py Orchestrator · main.py CLI · server.py REST API · session_manager.py Session manager
Components 21
Analysis pipeline
- Orchestrator
src/orchestrator.py - PDF extractor
src/agents/document_agent.py - Summary analysis
src/agents/summary_agent.py - Methodology analysis
src/agents/method_agent.py - Equation interpretation
src/agents/math_agent.py - Critical analysis
src/agents/critique_agent.py - Implementation guidance
src/agents/implementation_agent.py - Report aggregator
src/agents/aggregator_agent.py
Document tools
- PDF parsing
src/tools/pdf_parser.py - Text cleaning
src/tools/text_cleaner.py - Safe code execution
src/tools/code_exec.py
Sessions and quality
- Session manager
src/memory/session_manager.py - Report evaluation
src/evaluation/evaluator.py
Shared services
- Text chunking
src/utils/chunking.py - Report formatting
src/utils/formatting.py - Configuration
src/utils/config.py - Structured logging
src/utils/logger.py
Other components
- Researcher
- JSON and Markdown reports
Connections 18
- Researcher → CLI: submits paper
README.MD - Researcher → REST API: uploads paper
api/server.py - CLI → Orchestrator: starts analysis
README.MD - REST API → Orchestrator: starts analysis
api/server.py - Orchestrator → PDF extractor: extracts document
README.MD - PDF extractor → PDF parsing: parses PDF
src/agents/document_agent.py - Orchestrator → Summary analysis: analyzes summary
README.MD - Orchestrator → Methodology analysis: analyzes method
README.MD - Orchestrator → Equation interpretation: interprets equations
README.MD - Orchestrator → Critical analysis: critiques research
README.MD - Orchestrator → Implementation guidance: generates guidance
README.MD - Orchestrator → Report aggregator: synthesizes results
README.MD - Equation interpretation → Text cleaning: cleans text
src/agents/math_agent.py - Orchestrator → Session manager: stores session data
src/orchestrator.py - REST API → Session manager: retrieves reports
api/server.py - Orchestrator → JSON and Markdown reports: saves reports
README.MD - CLI → Session manager: lists sessions
src/main.py - Report evaluation → JSON and Markdown reports: evaluates quality
README.MD