> For the complete documentation index, see [llms.txt](https://cleyrop.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cleyrop.gitbook.io/docs/documentation-fr-en/le-druide/interroger-un-corpus-de-documents.md).

# Query a document corpus

The Cleyrop Corpus Search tool relies on RAG (Retrieval-Augmented Generation) technology to search for the most relevant passages in your documents and generate contextualized answers.

***

## Prerequisites

Before using the Corpus Search tool from Le Druide:

1. **Create a corpus** : the corpus must be created and have the status **Valid** in your project. See the page [Create and manage a corpus](/docs/documentation-fr-en/data-and-ai-project/studio-ai/corpus-de-documents.md) to learn more.
2. **Configure the token** : the Corpus Search tool requires an access token. Generate it from your **Personal space → Profile & Tokens**, then enter it in the tool configuration via the ⚙️ button in Le Druide.

## Available features

The Corpus Search tool allows you to interact with your documents in different ways:

| Capability                | Description                                             | Example question                                                                     |
| ------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **Content search**        | Find specific information in one or more documents      | "Where is the probation period mentioned in the HR policy?"                          |
| **Document summary**      | Get a summary of a document or a set of documents       | "Summarize the onboarding policy in 5 points."                                       |
| **Document comparison**   | Identify similarities and differences between documents | "What are the differences between the teleworking policy and the general HR policy?" |
| **Keyword extraction**    | List the main topics of a document                      | "What are the main topics covered in the recruitment guide?"                         |
| **Metadata**              | Display information about the corpus documents          | "List the documents available in my corpus."                                         |
| **Citable excerpts**      | Return short passages with their source                 | "Give me an excerpt from the disciplinary policy on grievance procedures."           |
| **Cross-document search** | Answer questions covering multiple documents            | "What does the company say about employee benefits?"                                 |

{% hint style="info" %}
**Note:**

1. The tool systematically cites its sources at the end of each answer, with the document name and an excerpt from the passage used.
2. It is not possible to perform the following actions:

* Modify or rewrite the corpus documents.
* Access files that have not been added to the corpus.
* Query external sources not present in the corpus.
  {% endhint %}

<figure><img src="/files/fc70ce97fbcee7e22fa4f43b583d71ccbe849a35" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/cb5064c39320c2b95b8109b5b0b01e6484f2e497" alt=""><figcaption></figcaption></figure>

***

### Best practices

* **Take care with document quality** : well-structured files, without approximate OCR and in a consistent language, produce better answers.
* **Use precise questions** : the more specific your question is, the more relevant the answer will be. Prefer "What are the eligibility conditions for teleworking?" to "Tell me about teleworking."
