English | ç®€ä½“ä¸æ–‡
Evidence-gated research scouting agent built with Rust.
LitScout-RS is a Rust-based research scouting agent for turning a research topic into an auditable, cited survey report and follow-up paper reading workflow.
The project is designed for course research, early-stage literature surveys, open-source technology selection, and research-oriented development. It does not try to behave like an unrestricted browser agent. Instead, it collects evidence from controlled sources, records how each item was found, filters noisy academic candidates, audits citation boundaries, and lets users continue from a generated report into paper-level reading notes and Q&A.
- Research workflow, not just search results: generates a research brief, chapter plan, query portfolio, evidence memory, coverage report, citation audit, and final Markdown report.
- Controlled multi-source collection: uses GitHub and arXiv by default, with optional Stage A academic expansion through Semantic Scholar, DBLP, OpenAlex, and Crossref.
- Evidence-first report generation: the writer can only cite URLs registered in
CitationLedger; source lineage and query attempts remain inspectable. - Accuracy-oriented expansion: academic candidates go through canonical merge, ranking, classification, and
EvidenceQualityGatebefore entering the report evidence pool. - Stateful agent control loop: state transitions, trace events, checkpoints, and PlanReady branching make each run reviewable instead of opaque.
- Integrated paper reading library: arXiv papers from the evidence pool can be added to the reading library for full-text or near-full-text fetching, structured notes, and single-paper follow-up Q&A.
- Rust backend with typed boundaries: API responses, sessions, checkpoints, evidence models, and LLM outputs are represented with typed Rust structures and serde-compatible JSON.
User research topic
-> Scoper creates ResearchBrief
-> Planner creates ChapterPlan and QueryPortfolio
-> PlanCritic reviews plan quality
-> User approves or revises the plan
-> GitHubScout / ArxivScout collect default evidence
-> Optional AcademicScout collects Semantic Scholar / DBLP / OpenAlex / Crossref
-> EvidenceBuilder performs canonical merge, ranking, classification, and EvidenceQualityGate
-> EvidenceMemory and CitationLedger are built with query lineage
-> CoverageCritic checks chapter-level evidence gaps
-> Writer generates a cited Markdown report
-> CitationAuditor checks URL whitelist, citation coverage, and source diversity
-> Reading Library supports arXiv paper notes and single-paper Q&A
The LLM is not allowed to browse freely or invent sources. It receives only evidence collected and registered by LitScout-RS, and final citations are checked against the citation ledger.
src/
main.rs # entry point and web server startup
cli.rs # command-line options
config.rs # AppConfig and environment handling
model.rs # SourceItem, EvidenceMemory, CitationLedger, run models
sources/ # GitHub, arXiv, Semantic Scholar, DBLP, OpenAlex, Crossref
agent/ # scoper, planner, scouts, evidence builder, writer, auditors
reading/ # arXiv reading library, text fetching, notes, paper Q&A
server/ # axum routes and SSE endpoints
ranking.rs # ranking signals
dedup.rs # canonical work merge
classify.rs # evidence classification
checkpoint.rs # secret-safe checkpoints
trace.rs # jsonl run trace
web/src/
components/ # React workbench views
api/ # typed frontend API client
- Rust stable toolchain with Cargo
- Node.js and npm for the web workbench
- DeepSeek-compatible chat completion endpoint
- Optional GitHub token for higher GitHub API rate limits
LitScout-RS reads runtime configuration from CLI flags and environment variables. A reference profile is documented in config.example.toml.
export DEEPSEEK_API_KEY=...
export DEEPSEEK_BASE_URL=https://api.deepseek.com
export DEEPSEEK_MODEL=deepseek-v4-pro
export DEEPSEEK_SIDE_MODEL=deepseek-v4-flash
export DEEPSEEK_MAX_TOKENS=4096
export DEEPSEEK_TIMEOUT_SECS=30
# Optional, recommended for GitHub rate limits.
export GITHUB_TOKEN=...
# Optional academic expansion providers.
export SEMANTIC_SCHOLAR_API_KEY=...
export OPENALEX_API_KEY=...
export CROSSREF_MAILTO=you@example.comDo not commit real API keys. Checkpoints and traces are designed not to persist secrets, but environment variables and local shell history still need normal care.
Build the frontend and start the Rust server:
cd web
npm install
npm run build
cd ..
cargo run -- --serve --port 3000Open:
http://127.0.0.1:3000
Recommended web workflow:
- Configure DeepSeek and optional GitHub token.
- Create a research run from a Chinese or English topic.
- Review the generated plan before collection starts.
- Approve the plan and watch run progress, events, and checkpoints.
- Inspect evidence, query lineage, coverage, and citation audit.
- Read the generated Markdown report.
- Add useful arXiv papers to the reading library for notes and single-paper Q&A.
Academic expansion is explicit. Enable it in the workbench policy only when you want Semantic Scholar, DBLP, OpenAlex, and Crossref to participate in the evidence pool.
The current main path requires LLM mode:
cargo run -- "rust agent framework" --llm
cargo run -- "llm tool calling" --llm --github-limit 10 --arxiv-limit 10
cargo run -- "llm agent benchmark" --llm --academic-extra --academic-limit 10DeepSeek options may be provided through flags when needed:
cargo run -- "rust agent framework" --llm \
--deepseek-api-key "$DEEPSEEK_API_KEY" \
--deepseek-base-url https://api.deepseek.com \
--deepseek-model deepseek-v4-pro \
--deepseek-side-model deepseek-v4-flash \
--llm-timeout 45 \
--llm-max-tokens 4096Reports are written to reports/<topic>-<timestamp>.md. Session summaries, traces, and checkpoints are written under sessions/ without API keys.
- Plan review and revision before evidence collection.
- SSE-based run progress for fetching, evidence building, synthesis, and audit stages.
- Evidence memory with source links, query attempts, lineage, and selection summary.
- Coverage matrix for chapter-level
QueryGapandSourceGapdiagnostics. - Citation audit for URL whitelist checks, citation coverage, and source diversity.
- Checkpoint listing and PlanReady branch creation.
- Markdown report preview.
- Reading library for arXiv paper ingestion, text-fetch diagnostics, structured notes, and single-paper streaming Q&A.
Core endpoints:
GET /api/healthPOST /api/planPOST /api/plan/revisePOST /api/runPOST /api/run/streamPOST /api/report/translate
Stateful run endpoints:
POST /api/runsGET /api/runs/:run_idGET /api/runs/:run_id/eventsPOST /api/runs/:run_id/approve-planPOST /api/runs/:run_id/continuePOST /api/runs/:run_id/revise-planGET /api/runs/:run_id/evidenceGET /api/runs/:run_id/coverageGET /api/runs/:run_id/citation-auditGET /api/runs/:run_id/checkpointsPOST /api/runs/:run_id/branch-from-checkpoint
Reading library endpoints:
GET /api/libraryPOST /api/library/itemsGET /api/library/items/:paper_keyDELETE /api/library/items/:paper_keyPOST /api/library/items/:paper_key/generate-notePOST /api/library/items/:paper_key/chat/stream
Report-level follow-up endpoints have been removed. Follow-up Q&A now belongs to the reading library, where the context is a single paper.
Rust:
cargo fmt
cargo check
cargo testFrontend:
cd web
npm run buildStage 3 fixture bench:
node scripts/stage3_eval.mjsThe mini bench validates the control-loop structure with fixture/mock data. It does not replace live GitHub, arXiv, academic-source, or LLM integration checks.
- Default sources are GitHub and arXiv.
- Stage A academic expansion is opt-in through
--academic-extraor the web run policy. - Open web search, browser automation, unrestricted ReAct, WeChat crawling, and general-purpose news crawling are intentionally out of scope.
- Academic-index and bibliography candidates must pass
EvidenceQualityGatebefore enteringEvidenceMemoryandCitationLedger. - The reading library is currently focused on arXiv papers. It can fetch text through Jina Reader and local PDF extraction, but it is not a general PDF/document analysis system.
CoverageCriticreports gaps and suggestions; it does not start an open-ended autonomous crawling loop.- Branching currently supports creating a new run from a PlanReady checkpoint.
- Paper chat uses an SSE interface. The current backend may buffer model output before sending Markdown chunks; token-native streaming can be added later.
Recommended GitHub project settings:
- Add a concise repository description, for example:
Rust research scouting agent with evidence-gated multi-source search, cited reports, and arXiv reading notes. - Add topics such as
rust,llm,research-agent,literature-review,arxiv,github-api,evidence,citation-audit. - Add a license file if this repository is intended to be public or reused.
- Keep
.env, API keys, generated sessions, local cache, and private reports out of commits. - Add screenshots or architecture diagrams under a tracked
docs/assets/directory if you want the README to show images on GitHub.
No license file is currently included. If the project will be published or reused, add an explicit license before release.
