Back to directory

LangChain Advanced RAG

An HR policy question-answering example built with LangChain LCEL that classifies whether a question is in scope before retrieving from a local FAISS index, refusing to answer out-of-scope questions.

LangChain Advanced RAG

LangChain Advanced RAG is an example project, organized from an original notebook teaching case into a full GitHub project with an API and tests, that answers questions about an HR policy handbook. It reads a Markdown employee handbook, splits it into semantic sections by heading, and builds a local FAISS vector index; when a question comes in, an LLM first classifies whether the question is within HR scope using recent conversation history, and a LangChain RunnableBranch then routes it to retrieval-and-answer or a direct refusal.

Compared to a naive RAG pipeline that only retrieves and generates, this project adds the scope classification guardrail, conditional routing, and a rolling window of the last 50 messages for multi-turn context, with the executed path shown in the frontend. The current version uses single-path vector similarity retrieval only, without hybrid BM25 search, query rewriting, or a reranking model, which the README notes explicitly as scope not yet included, despite the name "Advanced" referring to its orchestration rather than its retrieval technique.

It exposes a FastAPI REST API with Swagger docs and a responsive web UI, and includes unit tests and GitHub Actions.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.