benchen4395/alpha_agentic_search

Alpha Agentic Search — 分层记忆 RAG 检索问答系统

What it solves

Alpha Agentic Search (AAS) addresses the instability, high latency, and lack of persistence in traditional AI search agents. It aims to create a search experience similar to Perplexity, where the system becomes "stronger the more it is used" by implementing a structured, multi-agent pipeline and a hierarchical memory system that avoids the pitfalls of purely research-oriented, high-latency self-evolving agents.

How it works

The system follows a classic Route → Rewrite → Retrieve → Verify → Summary pipeline:

  1. Routing: A router determines if the query can be handled by a specialized tool (e.g., weather, GitHub, arXiv) or needs the retrieval pipeline.
  2. Query Rewriting: The query is rewritten to include time and location context before retrieval.
  3. Hierarchical RAG (L1–L5): The system retrieves information across five layers in parallel:
    • L1 (QA Cache): High-frequency Q&A for millisecond responses.
    • L2 (Commonsense): Wikipedia-based vector index for general knowledge.
    • L3 (History): Incremental FAISS index of successful previous answers to capture user preferences.
    • L4 (Web): Real-time web search via providers like Tavily or Serper.
    • L5 (Knowledge Graph): Wikidata-based structured facts for multi-hop queries.
  4. Fusion & Calibration: Results are merged using Reciprocal Rank Fusion (RRF) and calibrated via Platt scaling to a unified confidence score. It uses a "quota-based" fusion to ensure multiple entities in a single query are all represented.
  5. Summary & Attribution: An LLM generates the final answer with citations, which are then validated to prevent "citation hallucinations."

Who it’s for

  • AI Search Beginners: Those looking for a stable, well-documented framework to start with.
  • AI Engineers: Developers wanting to implement a production-ready search agent with latency governance and safety guards.
  • AI Search Architects: Professionals interested in hierarchical memory RAG and entity disambiguation in knowledge graphs.

Highlights

  • 5-Layer Memory Stack: Combines cache, Wikipedia, user history, live web, and knowledge graphs for comprehensive retrieval.
  • Confidence Calibration: Maps diverse scoring metrics (cosine, rank, hybrid) to a unified probability of relevance.
  • Latency Governance: Implements layer-specific budgets and "soft timeouts" to ensure the front-end response time has an upper bound.
  • Prompt Injection Protection: A three-layer defense (cleaning, XML tagging, and system prompt guards) to secure untrusted web content.
  • Entity Disambiguation: Uses a combination of popularity (in-degree) and context signals to distinguish between entities with the same name.
  • Self-Improving: Asynchronously archives successful answers into L1 and L3 to speed up future identical or similar queries.

Related

  • Project
  • Project
  • Project
  • Project
  • Project