![ASTRA Banner Image](https://github.com/rte-design/ASTRA.ai/raw/main/images/banner-image-without-tagline.png)
[![Follow on X](https://img.shields.io/twitter/follow/AstraFramework?logo=X&color=%20%23f5f5f5)](https://twitter.com/intent/follow?screen_name=AstraFramework) [![Discussion posts](https://img.shields.io/github/discussions/rte-design/astra.ai?labelColor=%20%23FDB062&color=%20%23f79009)](https://github.com/rte-design/astra.ai/discussions/) [![Commits](https://img.shields.io/github/commit-activity/m/rte-design/astra.ai?labelColor=%20%237d89b0&color=%20%235d6b98)](https://github.com/rte-design/astra.ai/graphs/commit-activity) [![Issues closed](https://img.shields.io/github/issues-search?query=repo%3Arte-design%2Fastra.ai%20is%3Aclosed&label=issues%20closed&labelColor=green&color=green)](https://github.com/rte-design/ASTRA.ai/issues) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/rte-design/ASTRA.ai/pulls) [![GitHub license](https://img.shields.io/badge/License-Apache_2.0-blue.svg?labelColor=%20%239b8afb&color=%20%237a5af8)](https://github.com/rte-design/ASTRA.ai/blob/main/LICENSE) [![](https://dcbadge.vercel.app/api/server/VnPftUzAMJ)](https://discord.gg/VnPftUzAMJ) [![GitHub watchers](https://img.shields.io/github/watchers/rte-design/astra.ai?style=social&label=Watch)](https://GitHub.com/rte-design/astra.ai/watchers/?WT.mc_id=academic-105485-koreyst) [![GitHub forks](https://img.shields.io/github/forks/rte-design/astra.ai?style=social&label=Fork)](https://GitHub.com/rte-design/astra.ai/network/?WT.mc_id=academic-105485-koreyst) [![GitHub stars](https://img.shields.io/github/stars/rte-design/astra.ai?style=social&label=Star)](https://GitHub.com/rte-design/astra.ai/stargazers/?WT.mc_id=academic-105485-koreyst) README in English 简体中文 [Lightning Fast](./docs/astra-architecture.md)   •   [Multimodal Interactive](./docs/astra-architecture.md#astra-extension)   •   [Highly Customizable](./docs/astra-architecture.md#-astra-extension-store)
ASTRA is a highly customizable platform that simplifies the development of AI agents like never before. With ASTRA, you can easily create lightning-fast, multimodal AI agents, even without any coding knowledge.

Voice Agent Showcase

[ASTRA Voice Agent](https://theastra.ai) We showcase an impressive voice agent powered by ASTRA, demonstrating its ability to create intuitive and seamless conversational interactions. [![Showcase ASTRA Voice Agent](https://github.com/rte-design/ASTRA.ai/raw/main/images/astra-voice-agent.gif)](https://theastra.ai)

Stay Tuned

Before we dive further, be sure to star our repository and get instant notifications for all new releases! ![ASTRA star us gif](https://github.com/rte-design/ASTRA.ai/raw/main/images/star-the-repo-confetti-higher-quality.gif)

Run Voice Agent Locally

Feel free to run the showcased voice agent locally. We provide a Docker image that you can easily build and run on both macOS and Windows. To start, make sure you have: - Agora App ID and App Certificate([Read here on how](https://docs.agora.io/en/video-calling/get-started/manage-agora-account?platform=web)) - Azure's [speech-to-text](https://azure.microsoft.com/en-us/products/ai-services/speech-to-text) and [text-to-speech](https://azure.microsoft.com/en-us/products/ai-services/text-to-speech) API keys - [OpenAI](https://openai.com/index/openai-api/) API key - [Docker](https://www.docker.com/) ```bash # Run the pre-built agent image docker run --restart=always -itd -p 8080:8080 \ -v /tmp:/tmp \ -e AGORA_APP_ID= \ -e AGORA_APP_CERTIFICATE= \ -e AZURE_STT_KEY= \ -e AZURE_STT_REGION= \ -e OPENAI_API_KEY= \ -e AZURE_TTS_KEY= \ -e AZURE_TTS_REGION= \ --name astra_agents_server \ agoraio/astra_agents_server:latest # Here are two TTS options, either one will work # Make sure to comment out the one you don't use # 1. using Azure -e TTS_VENDOR_CHINESE=azure -e AZURE_TTS_KEY= -e AZURE_TTS_REGION= # 2. using ElevenLabs -e TTS_VENDOR_ENGLISH=elevenlabs -e ELEVENLABS_TTS_KEY= ``` This should start an agent server running on port 8080. #### Mac with Apple Silicon You will need to uncheck "Use Rosetta for x86_64/amd64 emulation on apple silicon" option for Docker if you are on Apple Silicon.
![ASTRA Docker Setting](https://github.com/rte-design/ASTRA.ai/raw/main/images/docker-setting.gif)

Connect to Your Agent

You can use the showcase voice agent, in `/playground` folder, to test with the server you just started. The project is built on NextJS 14, hence it needs Node 18 or later. ```bash # Set up an .env file cp ./playground/.env.example ./playground/.env cd playground # Install npm dependencies & start npm i && npm run dev ``` 🎉 Congratulations! You now have a ASTRA powered voice agent running locally.

Agent Customization

To explore further, the ASTRA voice agent is an excellent starting point. It incorporates the following extensions, some of which will be interchangeable in the near future. Feel free to choose the ones that best suit your needs and maximize ASTRA’s capabilities. | Extension | Feature | Description | | ------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | openai_chatgpt | LLM | [ GPT-4o ](https://platform.openai.com/docs/models/gpt-4o), [ GPT-4 Turbo ](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4), [ GPT-3.5 Turbo ](https://platform.openai.com/docs/models/gpt-3-5-turbo) | | elevenlabs_tts | Text-to-speech | [ElevanLabs text to speech](https://elevenlabs.io/) converts text to audio | | azure_tts | Text-to-speech | [Azure text to speech](https://azure.microsoft.com/en-us/products/ai-services/text-to-speech) converts text to audio | | azure_stt | Speech-to-text | [Azure speech to text](https://azure.microsoft.com/en-us/products/ai-services/speech-to-text) converts audio to text | | chat_transcriber | Transcriber | A utility ext to forward chat logs into channel | | agora_rtc | Transporter | A low latency transporter powered by agora_rtc | | interrupt_detector | Interrupter | A utility ext to help interrupt agent |

Voice Agent Diagram

![ASTRA voice agent diagram](./images/image-2.png)

Customize Agent

You might want to add more flavors to make the agent better suited to your needs. To achieve this, you need to change the source code of extensions and build the agent yourselves. You need to prepare the proper `manifest.json` file first. ```bash # Rename manifest example cp ./agents/manifest.json.example ./agents/manifest.json cp ./agents/manifest.json.en.example ./agents/manifest.en.json cp ./agents/manifest.json.cn.example ./agents/manifest.cn.json # pull the docker image with dev tools and mount your current folder as workspace docker run -itd -v $(pwd):/app -w /app -p 8080:8080 --name astra_agents_dev ghcr.io/rte-design/astra_agents_build # for windows git bash # docker run -itd -v //$(pwd):/app -w //app -p 8080:8080 --name astra_agents_dev ghcr.io/rte-design/astra_agents_build # Enter docker image docker exec -it astra_agents_dev bash # Build agent make build ``` The above code generates an agent executable. To customize your prompts and OpenAI parameters, modify the source code in `agents/addon/extension/openai_chatgpt/openai_chatgpt.go`.

Start Server

Once you have made the necessary changes, you can use the following commands to start a server. You can then test it out using the ASTRA voice agent from the showcase. ```bash # TODO: need to refactor the contents # Agora App ID and Agora App Certificate export AGORA_APP_ID= export AGORA_APP_CERTIFICATE= # OpenAI API key export OPENAI_API_KEY= # Or QWEN key export QWEN_API_KEY= # Azure STT key and region export AZURE_STT_KEY= export AZURE_STT_REGION= # TTS # Here are three TTS options, either one will work # Make sure to comment out the one you don't use # 1. using Azure export TTS_VENDOR_CHINESE=azure export AZURE_TTS_KEY= export AZURE_TTS_REGION= # 2. using ElevenLabs export TTS_VENDOR_ENGLISH=elevenlabs export ELEVENLABS_TTS_KEY= # 3. using Cosy export COSY_TTS_KEY= # agent is ready to start on port 8080 make run-server ``` 🎉 Congratulations! You have created your first personalized voice agent.

Quick Agent Customize Test

The default agent control is managed via server gateway. For quick testing, you can also run the agent directly. ``` # rename manifest example cp ./agents/manifest.json.example ./agents/manifest.json cp ./agents/manifest.json.en.example ./agents/manifest.en.json cp ./agents/manifest.json.cn.example ./agents/manifest.cn.json # pull the docker image with dev tools and mount your current folder as workspace docker run -itd -v $(pwd):/app -w /app -p 8080:8080 --name astra_agents_dev ghcr.io/rte-design/astra_agents_build # for windows git bash # docker run -itd -v //$(pwd):/app -w //app -p 8080:8080 --name astra_agents_dev ghcr.io/rte-design/astra_agents_build # enter docker image docker exec -it astra_agents_dev bash make build cd ./agents # manipulate values in manifest.json to replace , , , with your keys ./bin/start ``` use [https://webdemo.agora.io/](https://webdemo.agora.io/) to quickly test. Note the `channel` and `remote_stream_id` needs to match with the one you use on `https://webdemo.agora.io/`

ASTRA Service

Discover More

Now that you’ve created your first AI agent, the creativity doesn’t stop here. To develop more amazing agents, you’ll need an advanced understanding of how the ASTRA works under the hood. Please refer to the [ ASTRA architecture documentation ](./docs/astra-architecture.md).

Join Community

- [Discord](https://discord.gg/VnPftUzAMJ): Ideal for sharing your applications and engaging with the community. - [Github Discussion](https://github.com/rte-design/astra.ai/discussions): Perfect for providing feedback and asking questions. - [GitHub Issues](https://github.com/rte-design/astra.ai/issues): Best for reporting bugs and proposing new features. Refer to our [contribution guidelines](./docs/code-of-conduct/contributing.md) for more details. - [X (formerly Twitter)](https://twitter.com/intent/follow?screen_name=AstraFramework): Great for sharing your agents and interacting with the community.

Code Contributors

[![ASTRA](https://contrib.rocks/image?repo=rte-design/astra.ai)](https://github.com/rte-design/astra.ai/graphs/contributors)

Contribution Guidelines

Contributions are welcome! Please read the [contribution guidelines](CONTRIBUTING.md) first.

License

This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.