Getting Started

Getting started

Setup a new project

Using our SaaS solution

Visit Agiflow (opens in a new tab) to sign-up with new account. Simply entering your organization name and we will automatically generate default project with development environment for you.

Run your own app

Clone our open-source github repo (opens in a new tab); then run the app with these commands:

cd dockers/dev
docker-compose up

Get the keys

After creating a new project on AGIFlow dashboard, navigate to Environment -> Settings to get the keys. The client key is used for our front-end sdks and api key for the backend sdks.

Enabling End-to-end Observability

In addition to our backend sdks, we also provide frontend sdks for you to understand and inspect your LLM application from end-to-end.

Backend LLM tracing

Install our client sdks with below command.

pip install agiflow-sdk

Once it's install, initialise the sdk as below:

agiflow.init(
    app_name = '<YOUR APP NAME>',
    api_key = process.env.API_KEY,
});

Agiflow uses Open Telemetry to automatically collect traces for you. To check which LLM libraries and frameworks we are supporting, please visit python-sdk.

ℹ️

If you are using docker-compose development, add api_endpoint to init function as http://localhost:3000/api/analytics. You can also set AGIFLOW_API_ENDPOINT environment variable to customise per environment.

Client side analytics

Install our client sdks with below command.

pnpm add @agiflowai/js-sdk

Once it's install, initialise the sdk as below:

import { Agiflow } from '@agiflowai/js-sdk';
 
const agiflowClient = new Agiflow();
agiflowClient.init(
process.env.CLIENT_KEY, // Agiflow client key (please don't use API key here)
{
    autoTrace: true
}
);

We set autoTrace to true to simplify the integration. You can also provide API pattern matching or manual trace for advanced integration later on.

⚠️

To enable E2E tracing from client, we'll need to add final step to the backend.

from agiflow import Agiflow
from agiflow.opentelemetry import extract_association_properties_from_http_headers
 
# Inside your API middleware, or router, do this
...
Agiflow.set_association_properties(
  extract_association_properties_from_http_headers(request.headers) # request: Request
)

Collecting user feedback with widget

To get user feedback, simply register openWidget to open the widget for manual inspection.

...
agiflowClient.openWidget();

That's it. Now simply launch your application to test feedback.