APEX Document Management (ADM) is a document store that runs in your Oracle database. With its AI Pack, people ask questions about their documents and get answers that name their sources.
How many vacation days can I carry over to next year, and when do I have to use them?
You can carry over up to 5 unused vacation days into the next year. 1
Carried-over days must be used by 31 March. After that date they expire. 1
To carry over more days, for example after a long project, your manager must approve it in writing. 2
Sources
1 vacation-policy-2026.pdf, section 4
2 hr-faq.docx, "Vacation"
Permissions
A question runs as the ADM user who asks it. The search returns only chunks from documents that this user may open, through folder permissions, group membership or a share.
So one collection can cover several departments, and each person still gets answers only from their own documents. There is no second permission model to keep in sync.
Indexing is separate from asking: to build the search index, the embedding model reads every document in the collection. The permission check applies when someone asks, before any text goes to the answer model.
Same question, two users: "How much did the repair of the Station Road burst cost?"
Customer service user
The documents do not contain this information.
Management user
The repair cost was £48,600. incident-report-IR-2026-031.pdf
Answers from our test, shortened. The incident report is in a folder that only management may open.
How it works
A collection is a set of documents that people can ask questions about. You choose which documents belong to it, and ADM keeps it up to date.
Point the collection at a folder, or at every document that carries a label (an annotation). A label on a folder covers everything in it, so one collection can span several departments.
ADM prepares your documents for search and updates the index when files change. You write no indexing code.
Ask in the collection manager, or in a chat on your own APEX page. Developers can also call it from PL/SQL, or give the collection to an AI agent as a search tool.
Collection manager
The collection manager in the ADM app shows every file, its chunks, and which reader produced its text: the built-in filter, a vision model or OCR. Test search shows the answer, the model that wrote it and the documents retrieved for it.
Question: "What compensation does a customer get for an unplanned interruption longer than 12 hours?"
Answer · ollama / gemma3:4b
An unplanned interruption longer than 12 hours gives a customer £40, plus £20 for each further 24 hours. The payment is credited to the next bill.
Retrieved documents (5)
customer-faq.html
on-call-policy.pdf
complaint-handling.rtf
and 2 more
For developers
Everything the collection manager does is also a PL/SQL call, so you can build answers into your own APEX pages and processes. The configuration is one JSON document: which documents, which embedding model, which answer model.
Create the collection
declare
l_id number;
begin
l_id := adm_ai_rag_api.create_rag_collection(
p_collection_name => 'company_kb',
p_config_json => '{
"source_file_annotation_key": "kb",
"content_type": "text",
"embedding": {
"provider": "openai",
"model": "text-embedding-3-small",
"dimensions": 1536,
"config": { "g_apex_web_credential": "OPENAI" }
},
"answer_model": {
"provider": "openai",
"model": "gpt-6.1-sol",
"config": { "g_apex_web_credential": "OPENAI" }
}
}'
);
end;Scroll sideways to see the full code.
Ask a question
l_answer := adm_ai_rag_api.generate_answer(
p_rag_collection_id => l_id,
p_query =>
'How many vacation days carry over?'
);What you get back
A Markdown answer with source references, from the documents that the current ADM user may open. The scheduled jobs keep the collection current, so there is no indexing code to write.
Features
PDF, Word, Excel, PowerPoint, OpenDocument, RTF, HTML, Markdown, CSV, text, JSON, XML and e-mail are read out of the box. For scans, a collection sends selected files to a vision model or an OCR service (ADM 26.2 or later).
Background jobs index new and changed files, and remove files moved outside the collection. Run a sync when users need newly uploaded content at once. Trashed documents are excluded immediately.
On Oracle 23ai or 26ai, the vectors stay in the same database, with nothing extra to run. On Oracle 19c, a collection uses a Qdrant server. You choose when you create the collection.
ADM calls the models through UC AI, our open-source PL/SQL library. OpenAI, OCI Generative AI, a local Ollama server and other providers work. API keys stay in APEX web credentials.
Give a collection to an AI agent as a search tool. The agent can split a long question into several searches. Show it in the UC AI Chat region on any APEX page.
A debug call stores the question, every matched chunk with its score, the sources and the prompt. Read it in the collection manager, or as a Markdown report from PL/SQL.
What you need
The document store that the collections read from, on Oracle APEX 24.2 or later. The AI Pack comes with every ADM license, is optional to install, and installs the UC AI library with it.
Oracle 23ai or 26ai keeps the vectors in the database, with Oracle AI Vector Search. On Oracle 19c, a collection stores its vectors in a Qdrant server.
A cloud provider, with its API key stored as an APEX web credential, or a local Ollama server. Cloud model and OCR usage is billed by the provider.
The database must reach the model provider and, if you use it, Qdrant. Configure a network ACL, and a proxy where your environment requires one.
Details are in the AI Pack installation guide. For licensing, see ADM pricing or ask us.
Tutorial · 7 lessons
From the first answer to an agent, an APEX chat page, per-user checks and tuning.
Reference
Every key of the configuration JSON, the sync jobs, and the PL/SQL calls to search and answer.
Guide
Create, sync and test collections, and see which reader produced the text of each file.
Common questions about RAG collections in APEX Document Management.
Still have questions?
Contact Our TeamWe show a RAG collection with users from different groups: the answers, the sources, and what each user may see. Bring your questions.