Skip to content

rakeshkky/promptql-audio-assistant

Repository files navigation

PromptQL Audio Assistant

Hasura DDN Project available at: https://console.hasura.io/project/organic-liger-4989

This Hasura DDN supergraph enables you to query in-ear monitors (IEMs) and their frequency responses. The AI assistant enabled by Hasura PromptQL helps you explore the sound signature of a specific IEM and compare it with other IEMs or target responses. Also get the IEM recommendations based on your sound preferences and genres.

Available Target Responses

  • JM1 (new meta)
  • Harman
  • Crinacle (IEF 2023)

Use Cases

Sound signature of an IEM

  • The assistang would explain the sound signature and tonality of an IEM.

  • Also provides comparisons with target (preference) curves

  • Compare IEMs

  • Get Eq recommendation

Get IEM recommendations

Ask For Recommendation IEM Recommendation IEM Recommendation score card

Getting started

Load measurements on your Postgres database.

Create the required tables:

-- Create the `iems` table to store information about each IEM
CREATE TABLE iems (
    iem_id SERIAL PRIMARY KEY,
    iem_name VARCHAR(255) UNIQUE NOT NULL
);

-- Create the `frequency_responses` table to store frequency and amplitude data for each IEM
CREATE TABLE frequency_responses (
    response_id SERIAL PRIMARY KEY,
    iem_id INT REFERENCES iems(iem_id) ON DELETE CASCADE,
    frequency_hz REAL NOT NULL,
    amplitude REAL NOT NULL
);

-- Create an index on the `frequency_hz` column for efficient querying
CREATE INDEX idx_frequency_responses_frequency ON frequency_responses (frequency_hz);
CREATE INDEX idx_frequency_responses_iem_id_frequency ON frequency_responses (iem_id, frequency_hz);

Load the measurement data in your database.

cd measurements
pip install -r requirements.txt

PG_URL= <your-postrgres-url-string> python load_db.py

Load eartip reviews on your Postgres database.

Create the required tables:

CREATE TABLE eartip_reviews (
    product TEXT PRIMARY KEY,
    bore_size TEXT NOT NULL,
    stem_length TEXT NOT NULL,
    feel TEXT NOT NULL,
    bass NUMERIC NOT NULL,
    midrange NUMERIC NOT NULL,
    treble NUMERIC NOT NULL,
    soundstage NUMERIC NOT NULL,
    vocal_presence NUMERIC NOT NULL
);
-- Indexes for optimizing queries
CREATE INDEX idx_product ON eartip_reviews (product);
CREATE INDEX idx_numeric_ratings ON eartip_reviews (bass, midrange, treble, soundstage, vocal_presence);

Load the eartip reviews data in your database.

cd eartips
pip3 install -r requirements.txt

PG_URL= <your-postrgres-url-string> python load_db.py eartip_reviews.txt

Set up Hasura DDN project

# .env
...
ANTHROPIC_API_KEY=<your-anthropic-api-key>

To use an OpenAI key instead, you’ll have to set OPENAI_API_KEY in your .env file and change the environment variable LLM to openai in the compose.yaml file.

  • Add your Postgres database url (must be accessible outside localhost) to the APP_PG_CONNECTOR_CONNECTION_URI in .env
  • Setup your DDN project ddn project init
  • Fire up your PromptQL project by
    • ddn supergraph build local
    • ddn run docker-start
  • Open the PromptQL playground by ddn console --local

Now you’re ready to query the sound signature of your chosen IEM and compare it with others or with target responses.

About

Hasura PromptQL on IEM frequency measurements. Analysis and compare IEM frequency responses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages