# Technology Stack

Below is the technology stack used for the implementation of the AI Assistant. AI Assistant primarily uses the RAG mechanism, powered by Marqo (for retrieval) and GenAI services to generate answers for the user's questions.

**Front End**

* Telegram (a Telegram Bot)
* WhatsApp (a WhatsApp business number)

**Backend**

* Python - Programming Language
* FastAPI - Web framework for building APIs with Python
* Marqo - Marqo is an end-to-end vector search engine. Vector generation, storage

  and retrieval are handled out of the box through API.
* Cloud Storage Services (Supported are OCI Object Storage & AWS Buckets)
* Frameworks
  * LangChain - Framework to simplify the creation of applications using large language models.
  * LlamaIndex - Flexible data framework for connecting custom data sources to large language models.
* For Telegram:
  * Telegram Service Wrapper - Webhook to receive the request from the user

    through a Telegram Bot and to respond with answers. The webhook is

    registered with the Telegram Service Provider.
  * Redis - In-memory data store for holding users language and bot selection
* For WhatsApp GupShup provider:
  * WhatsApp Service Wrapper - Webhook to receive the request from the user and to respond with answers. The webhook is registered with the WhatsApp Service Provider, which in this implementation uses Gupshup.
  * PostgreSQL - Used for storing the user's session, language selected and bot selection for WhatsApp.

### External Services

* GenAI Services - LLM for,
  * Text Generation
  * Supported ones are,
    * OpenAI (GPT4) with Moderation
    * Azure OpenAI (GPT4) with Moderation
* Language Services for,
  * Language Translation
  * Speech to Text
  * Text to Speech
  * Supported ones are,
    * Bhashini Dhruva
    * EkStep Dhruva
    * Google Language Services
* Telemetry - Log events are getting captured for
  * api\_access
  * api\_call

### Other Tools / Services

* Docker
* Cloud Infrastructure - Supported ones are,
  * OCI
  * AWS

### Dependencies

List of external libraries used: <https://github.com/Sunbird-AIAssistant/sakhi-api-service/blob/main/requirements-prod.txt>


---

# 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/technology-stack.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.
