recall-rag
Recall RAG
Recall RAG is an AI assistant for automotive-parts and vehicle-recall questions. It combines public NHTSA recall information with operational data and gives users answers they can inspect instead of giving the model unrestricted access to documents or a database.
Live demo: recall-rag.vercel.app

The system has four main parts:
Document search — find the recall notices and guidance that support an answer.
dbt data models — clean and combine recall, demand, inventory, and transfer data.
Text-to-SQL — turn a business question into validated, read-only SQL against approved models.
MCP tools — expose those capabilities through a small set of read-only tools for an LLM or external agent.
The intended operational question is concrete:
“Which critical brake recalls affect parts Dallas may run out of, what does NHTSA say the safety consequence is, and can Memphis cover the shortage without falling below safety stock?”
What is implemented
This is a working application with a Vercel frontend/API and Neon Postgres database. The main pieces are:
Area | What runs locally |
Ingestion | NHTSA recall API refresh and versioned official NHTSA PDFs with page metadata |
Retrieval | 500-token chunks, PostgreSQL full-text search, pgvector, hybrid ranking, and citation limits |
Embeddings | OpenAI |
Chat | LangGraph routing across document search, analytics, and source-status checks |
Analytics | dbt Core models and tests for recall intelligence, part demand, stockout risk, and transfer candidates |
Text-to-SQL | YAML semantic layer, typed intent, compiled read-only SQL, AST validation, and bounded results |
MCP | FastMCP over stdio and local Streamable HTTP with three read-only tools |
Evaluations | Retrieval, analytics, semantic-parser, and MCP protocol checks |
MCP integration
MCP (Model Context Protocol) is the interface an external AI client uses to call Recall RAG. Instead of giving Claude, Cursor, or Codex a database connection or access to the document directory, the MCP server exposes three specific operations with typed inputs and bounded outputs.
Available tools
search_recall_documentssearches the indexed NHTSA documents. It accepts a natural-language question, an optional campaign ID, and a small result limit. It returns ranked passages with source titles, pages, excerpts, and citation IDs.query_recall_analyticsanswers questions about the dbt data models. It accepts a business question such as “Which warehouse has the most shortage units?” and returns rows, the semantic terms used, the compiled SQL, and freshness information. It never accepts raw SQL from the client.get_data_statusreports whether the document index and analytics models are current, along with source counts, model versions, and the latest evaluation status.
How a request works
An external client connects to the MCP server and discovers the three tool schemas.
The client chooses a tool based on the user’s question.
The server validates the inputs, applies limits, and runs either hybrid document retrieval or the governed analytics compiler.
The server returns a small structured result. For document searches, every passage includes the information needed to cite the source.
The client writes the final answer using those results. It never receives unrestricted database credentials, filesystem paths, or the full document corpus.
A question that needs both kinds of evidence can call both search and analytics. For example, the document tool can provide NHTSA’s stated safety consequence while the analytics tool calculates which warehouse has a shortage. The answer can then keep those two sources separate instead of treating a generated statement as a fact.
Safety and limits
The MCP server is read-only. It cannot update inventory, trigger a refresh, execute arbitrary SQL, or access local files. Analytics queries are compiled from an approved YAML semantic layer, restricted to known metrics, dimensions, filters, and dbt models, then validated before execution. Retrieval results and analytics rows are capped. Tool calls record only safe operational metadata such as client, tool, status, latency, and result count.
The server supports stdio for desktop clients and local Streamable HTTP for integration tests. The MCP Access screen shows the available tools, connection status, recent calls, and client configuration examples. The protocol-level test suite checks tool discovery, schemas, retrieval results, SQL restrictions, row limits, refusal behavior, and freshness reporting.
Documentation
Run locally
Start the isolated pgvector database (port 5433 avoids interfering with a conventional local PostgreSQL server), install dependencies, and launch both services:
docker compose up -d postgres
python -m venv .venv
.venv/bin/pip install -r backend/requirements.txt
npm install
npm run devIn another terminal:
.venv/bin/python backend/server.pyThe frontend is available at http://localhost:5173; the API listens at http://127.0.0.1:8010.
To enable the model and real embeddings, create backend/.env from backend/.env.example and set OPENAI_API_KEY. The fallback mode remains useful for inspecting the deterministic retrieval, dbt, semantic compiler, and interface without a key.
API surface
GET /api/health— source, dbt, and model-mode statusPOST /api/chat— routed grounded answer, citations, compiled analytics evidence, and tool tracePOST /api/refresh— refresh NHTSA data, rebuild dbt marts, and reindex documentsGET /api/pipelines— workflow canvas nodesGET /api/semantic-layerandPOST /api/analytics/query— public semantic contract and governed analytics resultsGET /api/evaluations— retrieval and analytics benchmark scoresGET /api/documents/{version_id}/file— stored PDF used by the evidence viewerGET /api/mcp/tools— catalogue of the three actual MCP toolsGET /api/mcp/statusandGET /api/mcp/calls— live local MCP status, client setup details, and sanitized tool-call audit
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/subhan22x/recall-rag'
If you have feedback or need assistance with the MCP directory API, please join our Discord server