benchen4395/alpha_agentic_search
Alpha Agentic Search — 分层记忆 RAG 检索问答系统
What it solves
Alpha Agentic Search (AAS) addresses the instability, high latency, and lack of personalization in traditional AI search agents. It provides a controllable, low-latency framework for web-based Q&A that improves over time by implementing a hierarchical memory system, ensuring that frequent or previously answered questions are handled with millisecond response times while maintaining high factual accuracy.
How it works
The system follows a classic Route → Rewrite → Retrieve → Verify → Summary pipeline:
- Short-circuiting (L1): Checks a QA cache for exact or fuzzy matches to return answers instantly.
- Routing: Determines if a specialized tool (e.g., Weather, GitHub, arXiv) can answer the query; otherwise, it proceeds to retrieval.
- Rewriting: Injects time and location context into the query to improve search precision.
- Hierarchical RAG (L1–L5): Parallelly retrieves data from five layers: L1 (QA Cache), L2 (Wikipedia), L3 (History), L4 (Real-time Web), and L5 (Knowledge Graph). Results are fused using Reciprocal Rank Fusion (RRF) and calibrated to a probability of relevance.
- Summarization: An LLM synthesizes the retrieved evidence into a final answer with source attribution and citation verification.
Who it’s for
- AI Engineers and Architects looking for a production-ready search agent framework that prioritizes stability and latency over pure research.
- Developers wanting to build personal search assistants with a "get stronger with use" memory mechanism.
- Beginners in the AI search space who want a reference implementation of a multi-agent search pipeline.
Highlights
- 5-Layer Memory Stack: Combines fast caches, textbook commonsense, user history, real-time web, and structured knowledge graphs.
- Cross-Layer Score Calibration: Uses Platt scaling to map different scoring metrics (cosine, rank, etc.) into a unified confidence score.
- L1 Cache Guardrails: Implements a strict admission policy and "slot gate" consistency checks to prevent the caching of wrong or outdated answers.
- Prompt Injection Protection: Employs a three-layer defense (content cleaning, XML structural delimiters, and system prompt guards) to secure untrusted web content.
- Latency Governance: Features layered latency budgets, soft timeouts, and a strategic "RAG-first, LLM-last" warmup sequence to minimize TTFT.
- Entity Disambiguation: Uses a combination of popularity (in-degree) and query-context signals to resolve ambiguous entities in the Knowledge Graph.
Related
- Project
- Project
- Project
- Project
- Project