An agent that chooses where to search
A project by José Antonio Gallegos exploring how to combine documents, web search and language models in an automated workflow.
Python · LangGraph · RAG · FAISS · n8n · Gemini · SerpAPI
The problem and my contribution
Some questions require specific documents; others need current information. I built a learning project with a Python and LangGraph router, local retrieval with FAISS, SerpAPI web search, n8n orchestration and Gemini responses.
How it works
1. Question
A user asks a question.
2. Router
The flow selects a source.
3. Tool
It retrieves documents or searches the web.
4. Answer
The model responds using the context.
The original project was built for learning; this case study does not claim a production deployment or expose private documents.
Try retrieval with sources
Search two fictional sources locally or request a generated answer from Gemini.
Local search stays in your browser. The Gemini option sends your question and a fictional source to Google; do not enter sensitive information. Neither option runs LangGraph or FAISS.
Original code and standalone demo
The public notebook contains the original LangGraph and FAISS workflow, Gemini embeddings and SerpAPI web search. A separate command-line demo includes LangGraph, FAISS, tests and fictional documents.
The standalone demo uses simple deterministic vectors, not semantic embeddings; Gemini is optional. The original notebook was not run in this review.
What it demonstrates and limitations
The demo combines keyword retrieval and an optional Gemini call; it does not run the original LangGraph and FAISS project. Accuracy, performance and production deployment require separate evaluation.
Download offline demo