You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Research-Grade Memory-Augmented LLM Agent for Academic Literature Analysis
面向学术科研文献的记忆增强 LLM Agent — LangGraph · MultiQuery · Hybrid RAG · Persistent Memory
What It Does
A production-grade AI agent that combines retrieval-augmented generation, multi-query hybrid search, persistent three-tier memory, and automated survey writing into a unified CLI tool for academic research.
# Index 100 arXiv papers in seconds (deduplication built-in)
You > bulk_search RAG retrieval augmented generation LLM 100
[✓ 100 papers indexed | duplicates automatically skipped]
# Questions in ANY language — agent queries tools in English automatically
You > RAG系统最新的检索优化方法有哪些?
Agent → [tool call: "recent retrieval optimization methods RAG 2024"]
Agent > 根据最新论文,主要方法包括:(1) MultiQueryRetrieval...
来源: [CRAG, arXiv:2401.15884] [Self-RAG, arXiv:2310.11511]
# Save research insights to permanent memory
You > remember HyDE: embed hypothetical answer instead of query for better recall
[✓ Saved to memory #1 — injected into system prompt next startup]
# Generate a full survey (grounded in indexed papers)
You > survey Retrieval-Augmented Generation for Large Language Models
[Writing 8 sections via Map-Reduce, each grounded by hybrid retrieval...]
[✓ Saved: survey_Retrieval-Augmented_Generation_20260417_1800.md]
System Architecture
Key Features
Feature
Implementation
Research Basis
MultiQuery Retrieval
LLM generates 3 query variants → merge & dedup
Ma et al. (2023) — +20-40% recall
Hybrid Search
BM25 (sparse) + FAISS MMR (dense) + RRF fusion
Cormack et al., SIGIR 2009
LangGraph Agent
create_react_agent + MemorySaver
Replaces deprecated AgentExecutor
FastEmbed
BAAI/bge-small-en-v1.5 via ONNX Runtime
No PyTorch — ~150 MB vs ~1 GB
Chain-of-Thought Prompt
5-step reasoning + citation guidelines
Wei et al., NeurIPS 2022
arXiv Deduplication
Persistent ID set across sessions
Prevents vector store bloat
Bulk Indexing
arXiv API → 100+ paper abstracts
Rate-limited, progress bar
Survey Writer
Map-Reduce pipeline, 8 sections
RAG-grounded, saves to .md
3-Tier Memory
Working / Episodic / Semantic
Tulving (1972); Park et al. (2023)
Free API
SiliconFlow Qwen / Groq Llama
Zero cost to start
Retrieval Pipeline
Multi-Query → Hybrid → RRF
The full retrieval stack for every query:
User question (any language)
│
▼ [translated to English by Agent]
MultiQueryRetriever ─── generates 3 query variants via LLM
│ e.g. "RAG" → ["retrieval augmented generation",
│ "dense retrieval LLM grounding",
│ "knowledge-grounded language model"]
▼
For each variant:
┌── BM25 keyword search → ranked list A
└── FAISS MMR dense search → ranked list B
│
▼
RRF Fusion score = Σ 1 / (60 + rank + 1)
│
▼
Deduplicated Top-K results
BM25 — exact keyword match, best for technical terms & author names
FAISS MMR — semantic similarity with diversity (prevents redundant results)
RRF — rank fusion without score calibration (k=60, Cormack et al. SIGIR 2009)
MultiQuery — 3 phrasings per query, published to improve recall by 20–40%
Three-Tier Memory System
Tier
Type
Scope
Commands
1 — Working
LangGraph MemorySaver
Current session
automatic
2 — Episodic
Session archive (JSON)
Permanent, last 10
clear_memory, exit
3 — Semantic
User fact notes (JSON)
Permanent
remember / forget
Cross-session memory injection: On every startup, Tier 2 & 3 facts are injected into the agent's system prompt — the agent "remembers" your past research even after restart.
Inspired by Tulving (1972) Episodic & Semantic Memory, Park et al. (2023) Generative Agents, Zhong et al. (2024) MemoryBank
Survey Generation Pipeline
Map-Reduce workflow: for each of the 8 sections, the MultiQuery+Hybrid retriever finds the most relevant paper chunks; the LLM writes that section grounded in retrieved context; all sections are assembled into a final Markdown document.