Prevent Retrieval Dilution in Alfresco RAG with Metadata Filters
Описание и применение
В RAG-приложении при работе с большим репозиторием Alfresco возникает «распыление поиска» – нерелевантные, но семантически похожие фрагменты занимают верхние позиции, из-за чего модель не находит нужный ответ. Добавление шага анализа запроса, который выделяет семантическую часть и фильтр по сайту, позволяет ограничить поиск метаданными Alfresco и вернуть релевантные документы.
Задача
Retrieval dilution occurs when irrelevant but semantically similar document chunks occupy the top retrieval results, causing a RAG application to miss the correct answer.
Результат
The three-step metadata-aware RAG successfully mitigates retrieval dilution by filtering retrieval results based on Alfresco site metadata, ensuring relevant context is returned and the LLM can answer correctly.
Рабочий процесс
- Load documents from Alfresco into vector store preserving OpenDMA metadata.
- Ask a question and perform a similarity search on the vector store.
- Observe retrieval dilution when the Engineering document dominates the top results.
- Add a query analysis step that extracts a semantic query and a site filter using a structured LLM output.
- Retrieve chunks using both the semantic query and the site filter.
- Generate the answer from the filtered context.
- Validate that the answer is correct and relevant.
- Iterate if necessary.
Доказательства
A normal similarity search returned meeting notes from the project. These notes contain the decision to include localisation in phase 1, so the RAG application could answer the question.
This time, all ten results came from the Engineering document: ...
Alfresco does know this. Documents loaded through OpenDMA carry the repository metadata alongside their text.
We extend the normal two-step RAG with one query analysis step: question -> analyse query -> retrieve with filter -> generate answer
- Дата записи: 2026-11-03T15:13:58.329Z