AIsra – Agent for Interpretable Symbolic Regression and Analysis
Warning
This is not a production-ready application!
It is a prototype meant to demonstrate possible applications of LLM-powered AI agents in the area of prescriptive analytics and symbolic regression.
AIsra is an AI agent that can...
- train symbolic regression models on real-time data streams.
- react to concept drifts in the data stream by retraining the model when necessary. This is done by first training a single model that never changes ("base model"), and a second model that is retrained on the residuals of the base model when a drift is detected ("residual model").
- store the trained models in a Redis database and reuse them when possible to avoid unnecessary retraining.
- evaluate metrics of an SR model—such as model quality and feature importance—and use them to make decisions about how to improve the model and provide information to the user.
- explain certain aspects of the model as well as its decisions to the user in natural language.
- respond to user queries in natural language.
Furthermore, there is a frontend for interacting with the agent and visualizing the data stream, the trained models, and the metrics of the models in real time.
- Copy the
.env.examplefile in the root directory to.envand update the environment variables as needed (LLM_API_KEYand, unless disabled, the authentication settings are required). - Run
run-docker.sh(on Linux/macOS) orrun-docker.ps1(on Windows) to build and run the Docker containers. Runningdocker compose updirectly also works; thecert-initservice generates the development certificate if it is missing. - Access the application at the specified port in your web browser (http://localhost:3000 by default).
- Supply the agent with a data stream over MQTT (e.g. with janzenisek/dsg).
By default, users have to sign in with a Google account. To set this up, create OAuth credentials in the Google Cloud Console:
- Create (or select) a project and configure the consent screen under Google Auth Platform → Branding. Choose the External audience and publish the app under Audience; while it is in Testing, only the listed test users can sign in.
- Under Clients → Create client, choose Web application and add the authorized redirect URI
${PUBLIC_API_URL}/api/signin-oidc(e.g.https://localhost:5003/api/signin-oidc). - Set
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET, andFRONTEND_URLin your.envfile. - Set
AUTHORIZED_USERS_REGEXto a RegEx matching the email addresses of users who should get access (e.g.^[^@]+@example\.com$). Only email addresses verified by Google are considered.
Users without a Gmail or Google Workspace address can create a Google account for their existing email address at accounts.google.com/signup (Use my current email address instead).
Set USE_AUTHENTICATION=false to disable authentication.
If a container exits with Access to the path '/certs/localhost.pfx' is denied, the host path certs/localhost.pfx was created as a directory (usually because docker compose up ran before the certificate existed). Remove it and start the containers again:
rm -rf certs/localhost.pfx
docker compose up -dThe cert-init service regenerates the certificate on startup.
- Copy the
.env.examplefile in the root directory to.envand update the environment variables as needed (LLM_API_KEYand, unless disabled, the authentication settings are required). - Run the required services.
docker compose -f compose.dev.yml up -d- If you use the
Grpcclient type (default), run theAIsra.HeuristicLibWeb.Serverproject.
dotnet run --project ./backend/src/AIsra.HeuristicLibWeb.Server/- Run the web server project.
dotnet run --project ./backend/src/AIsra.Web/- Run the SvelteKit development server.
cd ./frontend/
pnpm install
pnpm dev- Access the application at the specified port in your web browser (http://localhost:5173 by default).
- Supply the agent with a data stream over MQTT (e.g. with janzenisek/dsg).
Click here to view the documentation.