RAG assistant over PDF documents with citations, precedence rules and an admin panel
An assistant that answers questions over a set of regulatory PDF documents (regulations, manuals, internal policies), applying validity and priority rules and citing the document and page.
When an organization's rules are spread across several PDFs (general regulations, annexes, later instructions, FAQs), finding a paragraph is the easy part. The hard part is knowing which one prevails. This assistant runs RAG over PDF documents with citations: it searches all of them, decides which text applies based on its validity and priority, and answers with the conclusion and citations to the document and page.
Who it is for
Organizations with long regulations, manuals or internal policies, and integrators that need a document assistant that says where every answer comes from.
What RAG over PDF documents with citations solves
- Searches that fail on synonyms or typos. It combines several kinds of search.
- Texts that contradict each other. It ranks rules by validity, version, document type and date.
- Answers with nothing behind them. Every answer carries its citations and is logged.
What it does
Upload and admin panel
- Uploads PDFs from the panel. The text is extracted on upload and split into citable sections based on the headings.
- Gives each document type a default priority, which you can adjust by hand.
- Translates sections into Spanish with AI, if you turn it on.
Search
- Searches by words, by meaning and by spelling similarity at the same time, and combines the results. Without meaning-based search, it works on text alone.
Precedence and answers
- Discards anything that is not in force according to its start and end dates, and does not mix different versions of a document.
- Gives priority to the later update over the earlier document.
- Answers with the conclusion, the rules applied, why they prevail and citations by document and page.
Traceability and control
- Keeps a trace of every answer: the question, the passages, the rules, the conflicts and how they were resolved.
- Collects user feedback: a dispute, a suggested correction or a validation.
- Protects the whole application with a username and password.
Benefits
- Your team finds the rule that applies without reading every document.
- Every answer can be checked, because it cites the document and page.
- User feedback points to the answers that need reviewing.
Industry context
General industry data with its public source. These are not results of this product.
- In 2025, the most common AI technology among EU enterprises was analysis of written language, present in 11.75% of them. Source: Eurostat, "Use of artificial intelligence in enterprises", 2025.
What you get with each license
Price upon request, depending on license type and scope. Integration support and maintenance are contracted separately.
- The module code: search, precedence, answers with citations and the upload panel.
- The database installation scripts.
- Integration documentation.
- A warranty against defects for the agreed period.
- Everything above, with the right to adapt it and maintain it inside your product.
- The right to integrate the asset into a commercial product of your own, identified in the contract.
- The right to distribute it to your customers as part of that product, without requesting authorization for each installation and with no limit on end customers, unless otherwise agreed.
- It does not include reselling or sublicensing the asset on its own.
- It is not exclusive, unless otherwise agreed.
- Maintenance, support and adaptations are contracted separately.
Technical specifications
Language and runtime: TypeScript 5.9 on Node.js. Minimum supported version: Node.js 20.19 (required by pdf.js 5).
Frameworks: Next.js 14.2 and React 18.3.
Database: PostgreSQL with the pgvector, pg_trgm and pgcrypto extensions.
Operating systems: Server with Node.js.
Interface languages: Spanish.
Required infrastructure:
- PostgreSQL with the pgvector, pg_trgm and pgcrypto extensions, on Neon (cloud service), because database access uses its HTTP driver.
- An AI provider for the answers: Anthropic or OpenAI (requires your own account).
- OpenAI for meaning-based search, optional (requires your own account).
Private deployment: It cannot run without an external connection: answers need the Anthropic or OpenAI API, and the database is reached through Neon's driver. Meaning-based search is optional.
Main libraries:
| Library | Version | License |
|---|---|---|
| next | 14.2.35 | MIT |
| react and react-dom | 18.3.1 | MIT |
| @anthropic-ai/sdk | 0.32.1 | MIT |
| pdfjs-dist | 5.6.205 | Apache-2.0 |
| @neondatabase/serverless | 0.10.4 | MIT |
Dependencies with specific license terms: None of the module's production dependencies has a copyleft license or specific commercial terms.
Compatibility and integrations: Anthropic Messages API (SDK 0.32); OpenAI API v1 (Chat Completions and Embeddings, with the text-embedding-3-small model at 1,536 dimensions); PostgreSQL with pgvector; PDFs with text.
Redistribution terms
The asset's own code can be integrated into the licensee's commercial products under the embeddable module, source code and OEM licenses, on the terms of the contract. None of the module's production dependencies has a copyleft license or specific commercial terms.
Installation requirements
A Node.js web application, on your server or on a compatible cloud platform, with PostgreSQL and the pgvector, pg_trgm and pgcrypto extensions. You need your own Anthropic or OpenAI key; the optional meaning-based search uses an OpenAI key. The PDFs must contain text. The interface is in Spanish.
Frequently asked questions
Does it work with scanned PDFs?
Not directly. They first need text recognition (OCR).
How does it decide which rule applies?
It discards what is not in force, does not mix versions, and then applies the priority of each document type and that of the most recent update.
Can we use our own AI provider?
Yes: Anthropic or OpenAI, with your organization's key.
Is maintenance included?
No. Maintenance (updates and bug fixes) and integration support are contracted separately.
Request
Request information on M-RAG-01
Fill in the form with the asset reference and the license type you're considering. I reply in writing. If you need to review code, tick the NDA box and we'll sign one before anything is shared.