# System architecture

**Overview**

Our architecture is designed to provide seamless integration and efficient processing of client requests through our Talkstack AI system. Below is a detailed overview of the components involved and the workflow.

**Workflow Description**

1. **Client Requests**: Clients interact with our system by sending RESTful API requests (GET/POST/PUT/DELETE) to our endpoints. These APIs are hosted on Microsoft Azure, ensuring high availability and reliability. While we typically host our API and MongoDB in the US, we have the flexibility to deploy in locations preferred by our customers.
2. **API Processing**: Upon receiving the client requests, our API layer processes the requests. This layer interfaces with a MongoDB instance for any necessary data storage and retrieval.
3. **Speech Processing**:
   * **Automatic Speech Recognition (ASR)**: The initial step in the call handling process is ASR, where the client's spoken input is converted into text.
   * **Talkstack LLM**: The text output from the ASR is then processed by our Talkstack Large Language Model (LLM). This AI component generates appropriate responses based on the input.
   * **Text-to-Speech (TTS)**: The generated text response is then converted back into speech using TTS technology, providing a vocal response to the client.
4. **Call Routing**: The entire process of ASR to TTS is part of the Talkstack calls component, with calls routed efficiently by Twilio to ensure smooth communication.

This architecture ensures that our system can handle client interactions effectively, providing accurate and timely responses using advanced AI and cloud technologies.

<figure><img src="https://68292813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCWDRDbVYBPtXK0SU8ItW%2Fuploads%2FtmunI195ie9K77HgUN3w%2FScreenshot%202024-06-05%20at%2009.55.04.png?alt=media&#x26;token=0143b6eb-3ea4-4907-8083-e5bcbdc8a550" alt=""><figcaption><p>Architecture diagram</p></figcaption></figure>


---

# 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://docs.talkstack.ai/system-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.
