Skip to content

✨ Adaptive AI assistant with RAG + web search fallback + agentic routing πŸŒπŸ“š Modular prompts & multi-LLM support 🧠

Notifications You must be signed in to change notification settings

Abdo-Mohammed-10/KnowledgeFlow_RAG_Haystack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Adaptive Agentic RAG Pipeline

✨ Adaptive AI assistant with RAG + web search fallback + agentic routing πŸŒπŸ“š

Python Haystack OpenRouter Status


πŸš€ Overview

RAGent is an advanced Adaptive RAG (Retrieval-Augmented Generation) pipeline that intelligently decides how to answer user queries using:

  • Internal document retrieval πŸ“š
  • Agentic LLM reasoning πŸ€–
  • Conditional routing for unknown queries πŸ”„
  • Web search fallback 🌐

It is designed to mimic human decision-making in multi-step reasoning pipelines and integrates seamlessly with multiple LLM providers via OpenRouter.


🧩 Features

  • Adaptive RAG: Dynamically retrieves and ranks relevant documents.
  • Agentic Control Flow: Conditional routing to select between internal knowledge or web search.
  • Web Search Fallback: Automatically queries the web if internal knowledge is insufficient.
  • Multi-LLM Integration: Supports OpenRouter, GPT models, and other LLMs.
  • Prompt Engineering: Modular and reusable prompt templates for different contexts.
  • Message Conversion: Converts prompts into LLM-compatible messages.
  • Monitoring Ready: Easily extendable to track latency, costs, and evaluation metrics.

πŸ—οΈ Architecture

flowchart LR
    User[User Query] --> Retriever[BM25 Retriever]
    Retriever --> PromptBuilder[Prompt Builder]
    PromptBuilder --> MessageConverter[ChatMessageConverter]
    MessageConverter --> LLM[OpenRouter LLM Generator]
    LLM --> Router[Conditional Router]
    Router -->|answer| Output[Return Answer]
    Router -->|go_to_websearch| WebSearch[SerperDev Web Search]
    WebSearch --> WebPrompt[Web Prompt Builder]
    WebPrompt --> WebMessageConverter[ChatMessageConverter]
    WebMessageConverter --> WebLLM[OpenRouter Web Generator]
    WebLLM --> Output

Loading

About

✨ Adaptive AI assistant with RAG + web search fallback + agentic routing πŸŒπŸ“š Modular prompts & multi-LLM support 🧠

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published