Initial Release
A web application which allows users to upload audio as a knowledge base and query with text.
The uploaded audio files are stored in IRIS as persistent objects,
and are also embedded using TwelveLabs API then stored as vectors.
To perform a query, the query text is first embedded using TwelveLabs API,
then a vector search is performed to find the most relevant audio embeddings,
then the corresponding audio files are retrieved,
and finally the query text is answered with the audio files as context using OpenAI API.
The upload and query operations are built as Business Operations using the IRIS Native Python SDK.
The FastAPI backend provides a REST API for external applications to interact with this system,
while the React frontend provides a UI to interact with the backend.
The (unpaid) TwelveLabs API is used for generating embeddings for uploaded audio files and query text.
To get your TwelveLabs API key:
API Keys
section under Settings
.Create API Keys
to create a new key, and copy the generated key.The (paid) OpenAI API is used for answering queries using audio files as context.
Note: Any API supported by BAML can be used in place of OpenAI.
Check the BAML docs for the list of supported APIs.
To get your OpenAI API key:
Create new secret key
to create a new key, and copy the generated key.git clone
cd iris-audio-query
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
npm --prefix community/ui/ install
.env.example
as .env
.docker-compose up
http://localhost:53795/csp/sys/UtilHome.csp
superuser
and password SYS
, or otherwise as specified in .env
.System Explorer
> Classes
.IRISAPP
namespace, or otherwise as specified in .env
.Import
and specify that the import file resides on My Local Machine
, and choose the file community/iris/IrisAudioQuery.Audio.cls
.Next
then Import
to import the Audio
class.docker exec -it iris-audio-query-iris-1 bash
Then from within the container,
python3 community/main.py
npm --prefix community/ui/ run dev
http://localhost:5173
.community/
├── app/ # FastAPI backend application
├── baml_client/ # Generated BAML client code
├── baml_src/ # BAML configuration files
├── interop/ # IRIS interoperability components
├── iris/ # IRIS class definitions
├── models/ # Data models and schemas
├── twelvelabs_client/ # TwelveLabs API client
├── ui/ # React frontend application
├── main.py # FastAPI application entry point
└── settings.py # IRIS interoperability entry point