How to create an automatic RAG with PDFs and web pages without training an AI
Published on 2026-11-16 by ArduBot
Architecture for uploading PDFs and URLs, extracting text, indexing it, and querying a knowledge base via API with citations and updates.
Do you have dozens of manuals, datasheets, or pages that change every week? The problem is not getting a language model: it is converting those files into retrievable information and keeping it up to date. An automatic RAG solves that part without having to retrain an AI for every new document.
What automatic means in a RAG system
RAG (Retrieval-Augmented Generation) retrieves fragments related to a question and delivers them as context to the model. “Automatic” should mean that when adding, modifying, or deleting a source, the system reprocesses what is necessary and leaves the index consistent. It does not mean that any PDF produces correct answers by magic.
Imagine a company with return policies in a PDF, instructions on its website, and a compatibility table. A customer asks: “Can I return this opened product?”. The assistant needs to find the current rule, recognize exceptions, and cite its source. If there is no applicable rule, it should indicate so.
Minimum flow: from a document to an answer
1. Loading and validation: receive the file or URL, check type, size, authorization, and origin. 2. Extraction: obtain text from HTML or PDF. A scanned document may require OCR; tables and columns need special treatment. 3. Fragmentation: divide by headings and meaning, preserving document, page, version, and date. Cutting every 500 characters without context can separate an exception from its rule. 4. Indexing: generate embeddings for semantic search; also consider literal search for codes, names, and exact references. 5. Query: filter by company and permissions before searching, retrieve fragments, and return ordered evidence. 6. Optional response: pass that evidence to the model, request citations, and allow “I do not have enough information”.
The index and the response model are distinct services. A retrieval API can deliver the relevant fragments without drafting a response: this way each client decides whether to use its own LLM.
A reasonable API contract
A conceptual query interface could receive:
{
"knowledge_base_id": "manuales-soporte",
"query": "¿Cuál es el plazo para devolver un producto abierto?",
"top_k": 5,
"filters": {"language": "es"}
} And return matches with text, score, source name, URL or page, and review date. The example does not represent an existing ArduMaker endpoint: it illustrates how to design a service that other applications can consume.
The company identifier should not be a free field that the user changes to view other people's information: it must be derived from the authenticated credential. Additionally, a high similarity score does not guarantee that the text contains the answer.
What usually breaks the first prototype
- A URL requires logging in and the crawler captures a blank screen. - Two versions of the manual remain active and produce contradictory answers. - A PDF with tables mixes rows during extraction. - The system indexes a deleted document, even though it is no longer visible in the panel. - The model drafts a safe response without fragments to support it.
The correction does not always consist of increasing the value of top_k: sometimes you need to improve the parser, add metadata, detect duplicates, or allow the system to abstain.
How to validate the result before offering it
Prepare 30 real questions, 10 questions with no available answer, and 10 with exact references. For each one, record whether the correct source was retrieved, whether the citation matches, and whether the answer invented conditions. Also measure indexing time, query latency, and cost per document.
Opportunity for ArduMaker: we are evaluating incorporating an automatic RAG node that allows uploading sources and querying results via API. This is a proposal under study, not a feature announced as available. If it would be useful to you, indicate how many documents you have, how they are updated, and what application would consume the API by visiting ArduMaker.
To learn more: Introduction to RAG in Microsoft · Basic RAG in ArduMaker.