RAG was always a bit of a hack. Chunk your files, embed them, cross your fingers the right snippet comes back. Fine for fuzzy "what did this doc say" questions. Terrible for structured data, where you don't want a summary, you want the exact number.
If your data lives in a database, there's a cleaner move in 2026: skip the vectors and let the model query the database directly through MCP (Model Context Protocol). The model writes SQL, your local server runs it, you get the real answer back. Nothing gets uploaded to anyone's cloud.
Here's a minimal, working MCP server that does exactly that for SQLite. About 30 lines.
The server
β
# server.py import sqlite3 from mcp.server.fastmcp import FastMCP
mcp = FastMCP ( " local-sqlite " ) DB_PATH = " app.db "
@mcp.tool () def list_tables () -> list [ str ]: """ List the tables in the database. """ con = sqlite3 . connect ( DB_PATH ) try : rows = con . execute ( " SELECT name FROM sqlite_master WHERE type= ' table '" ).β¦