Skip to content

RAG in NappAI

RAG (retrieval-augmented generation) is how an AI agent answers with your information instead of only what the model knows in general. Before answering, the agent looks in your documents or your data for the pieces related to the question, and writes the answer from them.

It works in two moments:

  1. Preparing the knowledge (ingestion). Your documents are split into chunks, each chunk is turned into a vector (a numeric fingerprint of its meaning) and stored in a vector database. You do it once, and again whenever the documents change.
  2. Answering (query). When a question arrives, the most similar chunks are found, ordered and handed to the agent, which answers using only what it found.

In NappAI every step is a component on the canvas. You choose the database, how documents are chunked, the vector model, the search technique and the agent, and you combine them without writing code.

This video walks through a complete RAG: an assistant for the technicians of a coffee-machine repair service that searches all the documentation, filters by brand and queries the incident history.

What you see in the video

  1. The knowledge base: 9 PDFs kept in NappAI storage. They are the manuals of the Jaltec Brío 2G, the Vellani Aurora 2G and 3G and the Molinar M64 OD grinder, the warranty and rates, the maintenance guide, three monthly incident reports and the FAQ. The same error code means different things on each brand.
  2. The “Knowledge base · ingestion” flow: one Storage Files lists the files (List Files) and another reads them one by one in Batch Mode (Get File). Contextual Text Splitter cuts them into chunks with context, Metadata Tagger tags each chunk with the brand, the document type, the month and the codes that appear, and Qdrant stores them with the vectors from FastEmbed Embeddings (Local). It runs live and you see the table of tagged chunks.
  3. The “Neo4j GraphRAG · store records” flow: Storage Files reads the incidents file and Neo4j GraphRAG in the Add Records operation stores each one linked to its bar, its technician and its machine with three lines in Relationships. Run it: 24 incidents and 72 relationships in a second. GraphRAG explains both ways to fill the graph.
  4. The “Technical assistant · the whole RAG” flow: an Agent (DeepSeek) with three tools. “Search the documentation” joins BM25 Retriever and Qdrant in an Ensemble Retriever, and Local Rerank keeps the best 5. “Search by brand” is Qdrant with a metadata filter in Dynamic mode that the agent fills in from the question. “Query incidents” is Neo4j GraphRAG in the Text2Cypher operation over the incident graph, where each incident is linked to its bar, its technician and its machine.
  5. “Which part is VL-2210…?”: the PT1000 temperature probe of the Vellani Aurora.
  6. “My Vellani Aurora shows error E07…”: blocked flowmeter, part VL-1180 and real cases. It also warns that E07 means something else on the grinder.
  7. “Which open incidents does Lucía Ortega have…?”: all three, each with its bar, taken from the graph. And asked how much a new Vellani Aurora costs, it says it does not have that data instead of making it up.

Both flows are explained in the recipe Technical assistant with manuals and a graph.

One video per technique

Each technique in the assistant has its own video, with the same knowledge base:

TechniquePage with its video
Metadata filters: only one brand’s documentsRetrieval techniques and Qdrant
Self Query: a model writes the filter from the questionSelf Query Retriever
Hybrid search and reranking, for codes and referencesLocal Rerank
Multi Query and compression, for questions phrased in other wordsMulti Query Retriever
Small chunk, whole sectionMulti Vector Retriever
RAG agent with sources and checksRAG agent
Measuring the answers of your own RAGRAG Evaluator

The kinds of RAG you can build in NappAI

There is no single best RAG. Each kind solves one kind of question, and it is common to combine two or three. The cost figures come from our measurements: they are a guide, not a promise.

KindQuestions it answersComponentsCost and time per questionWhen to choose it
Basic RAG with a vector databaseQuestions phrased in other words: “how often do I replace the portafilter gaskets?”A text splitter, FastEmbed Embeddings (Local) and a vector database (FAISS, Chroma DB, Qdrant, PGVector)No model calls. Tens of milliseconds.Always, as the starting point.
Hybrid RAG (keywords + meaning)Questions with exact codes, references or names: “which part is JT-777?”BM25 Retriever and the vector database, joined in an Ensemble RetrieverNo model calls. A few extra milliseconds.Your information is full of error codes, product references or order numbers.
RAG with rerankingWhen the right chunk shows up, but not first.Local Rerank (free, on the platform) or Cohere Rerank (Cohere’s service)No language model calls. 1 to 2 seconds with 20 to 30 candidates.You want to give the agent a few good chunks and drop the unrelated ones.
RAG with context (contextual retrieval)Chunks that do not say what they are about: “This code means…”, “Replace the part…”Contextual Text Splitter at ingestionOne model call per chunk, only when preparing documents. Nothing at question time.Manuals, contracts or reports whose sections do not repeat the product or period. Together with reranking, the best measured combination.
RAG with tags and filtersQuestions that narrow by brand, month, document type or product: “error E07 on the Vellani”Metadata Tagger at ingestion, and SelfQueryRetriever or the vector database’s filters at search timeOne call per chunk to tag. With SelfQueryRetriever, one more call per question (about 1 second).The same term means different things in different documents, or users ask about a period or a category.
GraphRAGQuestions that cross relationships: “faults similar to this one, with their customer and technician”Neo4j GraphRAG in Vector + Graph or Hybrid + Graph modeNo model calls. Tens of milliseconds.Your data are entities linked to each other (customers, machines, technicians, orders) and you want what is related to each result.
Structured queryCounting, ranking or filtering records: “how many open incidents does Lucía have?”, “which customer has the most?”Neo4j GraphRAG in the Text2Cypher operation, or an SQL query you prepare with SQLRetrieverToolText2Cypher: one model call to write the query, about 1 second. A prepared query needs no model.You have operational records (incidents, orders, tickets) and questions ask for exact figures.
RAG agent with verificationPolicies, terms or support, where a made-up answer is costly.RAG Agent with one or more retrieversSeveral calls per question: it scores each document and checks the answer. The slowest option.You prefer “I can’t find it” to a doubtful answer, and want every answer checked without setting it up yourself.

How to choose

  • Start with basic RAG using FastEmbed Embeddings (Local) and the vector database that suits you best. It already handles questions phrased in other words well.
  • If your users ask about codes or references, add Local Rerank or hybrid search.
  • If many chunks do not say what they are about, use Contextual Text Splitter at ingestion.
  • If questions narrow by brand, month or document type, store that data on every chunk and filter by it.
  • If questions count, rank or filter records, those records belong in a database that is queried (a Neo4j graph or an SQL database), not in text chunks.
  • If a wrong answer has consequences, use the RAG Agent or, at the very least, tell the agent in its instructions to say “I don’t know” when it cannot find something.

The combination that worked best in our measurements was contextual chunks, hybrid search and Local Rerank. It had the answer among the first five results for every question about documents, against 83 % for basic search. Details in Retrieval techniques.

What NappAI gives you

  • Everything is a component. The database, the chunking, the vector model, the search technique, the reranking and the agent are chosen and connected on the canvas, without code. Changing technique means changing a component.
  • Local, free options. FastEmbed Embeddings (Local) computes the vectors and Local Rerank reorders the results inside the platform: no API key, no per-use cost and your texts are not sent to another service.
  • Several sources in one agent. An Agent can have the manual search, the incident graph query and any other component as tools, and use whichever each question needs.
  • Graphs and records next to documents. With Neo4j GraphRAG the same agent answers relationship and counting questions that a document search cannot.
  • Measured. We tested the databases, techniques and vector models with the same questions. The results are in How we measured it.

In this section

PageWhat you will find
Vector databasesFAISS, Chroma, Qdrant, PGVector and Neo4j compared, and which to choose.
Vectorising and taggingFrom files to chunks: splitters, context, vector models and tags.
Retrieval techniquesWhich search technique to use for each kind of question, and how to make the agent say “I don’t know”.
GraphRAG with Neo4jWhen a graph answers better, the five modes and how to prepare Neo4j.
RAG agentThe RAG Agent: what each option does, what it costs and recommended setups.
Step-by-step examplesThree complete flows to build as they are.
How we measured itThe test, its results and its limits.