# Architecture

Below is a high-level diagram of the various components powering the AI Assistant.

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

## Components

#### sakhi-api-service

This is the backend service that takes a question and generates a relevant answer using the RAG mechanism. The answers are based on the information in a set of ingested documents. The service has to be configured with the specific marqo indexes to retrieve the sections of relevant documents and the GenAI prompts to generate a response in the required form.

Code:&#x20;

{% embed url="<https://github.com/Sunbird-AIAssistant/sakhi-api-service>" %}

#### Ingest-Documents Script

Document ingestion into the Marqo vector database is done through the below standalone python script.&#x20;

{% embed url="<https://github.com/Sunbird-AIAssistant/sakhi-api-service/blob/main/index_documents.py>" %}

Details on how to run is available under “To ingest data to marqo” section in the below readme file:&#x20;

{% embed url="<https://github.com/Sunbird-AIAssistant/sakhi-api-service/blob/main/README.md>" %}

#### sakhi-telegram-unified-service

This is a webhook service that registers with Telegram Service to oer the bot flow in the Telegram client. This doesn’t have any APIs exposed to the consumers. The calls to this service are delegated through the Telegram Service.

Code:&#x20;

{% embed url="<https://github.com/Sunbird-AIAssistant/sakhi-telegram-unified-servicewhatsapp-bot>" %}

#### whatsapp-bot

This is a webhook service that registers with WhatsApp Gupshup Service to oer the bot flow in the WhatsApp client. This doesn’t have any APIs exposed to the consumers. The calls to this service are delegated through the WhatsApp Gupshup Service.

Code:&#x20;

{% embed url="<https://github.com/Sunbird-AIAssistant/whatsapp-bot>" %}


---

# Agent Instructions: 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:

```
GET https://ai-assistant.sunbird.org/technical-overview/architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
