> For the complete documentation index, see [llms.txt](https://docs.eduplex.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eduplex.eu/text-analysis/ai-tutor-rag-system.md).

# AI Tutor - RAG system

## RAG System Overview <a href="#title-text" id="title-text"></a>

Our Retrieval-Augmented Generation (RAG) system is a robust framework designed to enhance the accessibility and usability of learning content. The system operates through three interconnected processes.

<figure><img src="/files/BVwuXC4eWIdl68M5m7Ge" alt=""><figcaption><p>RAG Overview created by EduPLEx</p></figcaption></figure>

First, during the **ingestion phase**, the learning content is processed into structured text chunks, which are then stored in an OpenSearch index to enable efficient retrieval.

Next, in the **retrieval phase**, the system leverages the capabilities of OpenSearch to identify and retrieve the most relevant text chunks based on user queries, ensuring accuracy and relevance.

Finally, the **answer generation phase** utilizes a Large Language Model (LLM) to synthesize coherent and contextually appropriate responses, drawing from the retrieved content. This integrated approach ensures that users receive precise and informative answers tailored to their needs, making the system a powerful tool for knowledge exploration and learning.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eduplex.eu/text-analysis/ai-tutor-rag-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
