Spaces:
Runtime error
Runtime error
| # Architecture: ResearchLink AI | |
| ## Overview | |
| ResearchLink AI is a sequential multi-agent pipeline where each agent handles one concern and passes structured Pydantic models to the next. | |
| ## Pipeline Flow | |
| ``` | |
| IngestionInput (user) | |
| β | |
| βΌ | |
| IntakeAgent ββββββββββββββββ validates + normalises inputs | |
| β | |
| βΌ | |
| SourceResolverAgent ββββββββββ downloads PDF, checks URLs | |
| β | |
| βΌ | |
| PDFExtractionAgent βββββββββββ extracts text + structure | |
| β | |
| βΌ | |
| MetadataAgent ββββββββββββββββ builds PaperMetadata (+ LLM) | |
| β | |
| βΌ | |
| CitationVerificationAgent βββββ parses + classifies references | |
| β | |
| βΌ | |
| GitHubRepoAnalyzerAgent βββββββ inspects code repository | |
| β | |
| βΌ | |
| [Content Agents β all run in sequence, all use LLM] | |
| PaperDigestAgent | |
| LiteratureReviewAgent | |
| ConceptMapAgent | |
| ImplementationLinkAgent | |
| ReproducibilityAgent | |
| LimitationsAgent | |
| TeachingPathAgent | |
| LabsGeneratorAgent | |
| β | |
| βΌ | |
| ReviewerAgent ββββββββββββββββ quality-checks all content | |
| β | |
| βΌ | |
| ExportAgent βββββββββββββββββββ writes files to disk | |
| β | |
| βΌ | |
| GenerationReport | |
| ``` | |
| ## Key Design Decisions | |
| **Pydantic schemas:** All inter-agent data is typed. No raw dict passing between agents. | |
| **LLM for content, heuristics for structure:** Structural extraction (PDF parsing, URL checking, citation regex) uses deterministic code. Content generation (digest, review, labs) uses the Claude API. | |
| **Fail-open with flags:** If an agent step fails (LLM error, URL unreachable), it returns a partial result with notes and continues. Errors are collected in the GenerationReport. | |
| **Honest labels:** All generated content uses `[paper-claim]`, `[agent-interpretation]`, and `[needs-verification]` labels throughout. | |
| ## File Structure | |
| ``` | |
| src/researchlink/ | |
| cli.py β Typer CLI entrypoint | |
| pipeline.py β Pipeline orchestrator | |
| config.py β Settings (env vars / .env) | |
| schemas/ β Pydantic data models | |
| agents/ β One file per agent | |
| services/ β Reusable utilities (PDF, HTTP, GitHub, etc.) | |
| templates/ β Jinja2 templates (for structured sections) | |
| validators/ β Output and citation validation | |
| ``` | |