rte-design / ASTRA.ai

A lightning-fast workflow builder, it supports multimodal interaction, highly customizable extensions, and is intuitive to use even without any coding knowledge.
https://theAstra.ai
Apache License 2.0
184 stars 20 forks source link
agent ai chatbot cpp gemini golang gpt-4 llm multimodal nextjs14 nodejs openai python realtime realtime-framework typescript voice-assistant workflow

ASTRA Banner Image

[![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

We showcase an impressive voice agent powered by ASTRA, demonstrating its ability to create intuitive and seamless conversational interactions.

Showcase ASTRA Voice Agent

Stay Tuned

Before we dive further, be sure to star our repository and get instant notifications for all new releases!

ASTRA star us 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:

# Run the pre-built agent image
docker run --restart=always -itd -p 8080:8080 \
        -v /tmp:/tmp \
        -e AGORA_APP_ID=<your_agora_appid> \
        -e AGORA_APP_CERTIFICATE=<your_agora_app_certificate> \
        -e AZURE_STT_KEY=<your_azure_stt_key> \
        -e AZURE_STT_REGION=<your_azure_stt_region> \
        -e OPENAI_API_KEY=<your_openai_api_key> \
        -e AZURE_TTS_KEY=<your_azure_tts_key> \
        -e AZURE_TTS_REGION=<your_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=<your_azure_tts_key>
-e AZURE_TTS_REGION=<your_azure_tts_region>

# 2. using ElevenLabs
-e TTS_VENDOR_ENGLISH=elevenlabs
-e ELEVENLABS_TTS_KEY=<your_elevanlabs_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.

# 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 , GPT-4 Turbo , GPT-3.5 Turbo
elevenlabs_tts Text-to-speech ElevanLabs text to speech converts text to audio
azure_tts Text-to-speech Azure text to speech converts text to audio
azure_stt Speech-to-text Azure 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

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.

# Rename manifest example
cp ./agents/manifest.json.example ./agents/manifest.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 agoraio/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.


# Agora App ID and Agora App Certificate
export AGORA_APP_ID=<your_agora_appid>
export AGORA_APP_CERTIFICATE=<your_agora_app_certificate>

# OpenAI API key
export OPENAI_API_KEY=<your_openai_api_key>

# Azure STT key and region
export AZURE_STT_KEY=<your_azure_stt_key>
export AZURE_STT_REGION=<your_azure_stt_region>

# Here are two 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=<your_azure_tts_key>
export AZURE_TTS_REGION=<your_azure_tts_region>

# 2. using ElevenLabs
export TTS_VENDOR_ENGLISH=elevenlabs
export ELEVENLABS_TTS_KEY=<your_elevanlabs_tts_key>

# agent is ready to start on port 8080

make run-server

🎉 Congratulations! You have created your first personalized voice agent.

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 .


Join Community

ASTRA


Contribution Guidelines

Contributions are welcome! Please read the contribution guidelines first.


License

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