Skip to content

Build an AI Agent that accepts natural language questions concerning the Backblaze Drive Stats data set, generates SQL queries, and responds with natural language answers.

License

Notifications You must be signed in to change notification settings

backblaze-b2-samples/ai-agent-demo

Repository files navigation

Build your own AI Agent with Backblaze B2 + LangChain

The notebooks in this repository shows you how to build an AI Agent that accepts natural language questions concerning the Backblaze Drive Stats data set, generates SQL queries, and responds with natural language answers.

There are currently two notebooks:

Configuration

You must configure the notebook(s) with your API credential(s). You can either set environment variables or use a .env file. To do the latter, copy .env.template to .env, then set the relevant API key(s) as explained below.

Remember - never put secrets in source code!

OpenAI

To use the OpenAI API, you must sign up for an OpenAI account and create an OpenAI API key.

Either set an environment variable, or edit your .env file:

OPENAI_API_KEY=<your-openai-api-key>

DeepSeek

To use the DeepSeek API, you must sign up for a DeepSeek account and create a DeepSeek API key.

Either set an environment variable, or edit your .env file:

DEEPSEEK_API_KEY=<your-deepseek-api-key>

Running the Notebooks

Both notebooks should run on any Jupyter-compatible platform:

JupyterLab Settings

If you are deploying JupyterLab on a virtual machine at a cloud provider, you will need to configure it to accept connections from the internet. Here is the configuration we set in ~/.jupyter/jupyter_server_config.py for this purpose:

# Allow requests where the Host header doesn't point to a local server
c.ServerApp.allow_remote_access = True

# The IP address the Jupyter server will listen on.
# 0.0.0.0 = all addresses
c.ServerApp.ip = '0.0.0.0'

# Allow access to hidden files
# Set to True to allow access to .venv
c.ContentsManager.allow_hidden = True

About

Build an AI Agent that accepts natural language questions concerning the Backblaze Drive Stats data set, generates SQL queries, and responds with natural language answers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published