Learn how to add evaluations to a multi-agent LangGraph chat bot using Galileo
app.py
- This contains the main application logic for a Chainlit app. It has an on_chat_start
function that is called whenever a new chat is started, and a main
function that is called whenever a message is sent.src/galileo_langgraph_fsi_agent/agents/supervisor_agent.py
- This is a LangGraph supervisor agent that manages the other agents, routing messages where needed. This is configured to use GPT-4.1-mini.src/galileo_langgraph_fsi_agent/agents/credit_card_information_agent.py
- This is a LangGraph agent that uses a tool to extract information about the available credit cards from Pinecone. This is also configured to use GPT-4.1-mini.src/galileo_langgraph_fsi_agent/tools/pinecone_retrieval_tool.py
- This is a LangGraph tool that interacts with the Pinecone vector database. It is called by the credit_card_information_agent
.sdk-examples/python/agent/langgraph-fsi-agent/before
folder in the cloned repo.
Open the starter project in your Python IDE of choice.
Install the dependencies that are defined in the pyproject.toml.
uv
:Configure your .env file.
.env.example
file to .env
, and set the values for your OpenAI and Pinecone API keys:<Your OpenAI API key>
with your OpenAI API key. Replace <Your Pinecone API key>
with your Pinecone API key.Upload the dummy credit card documentation to Pinecone using the provided helper script.
Run the project to test it out.
Create a new project from the Galileo Console using the New Project button.
bank-chatbot
.Install the Galileo Python package in your virtual environment.
Add the following Galileo environment variables to your .env file.
<Your Galileo API key>
with your Galileo API key. The project is set to the new project you just created, and the Log stream is set to chatbot-logs
.sdk-examples/python/agent/langgraph-fsi-agent/after
folder in the cloned repo.Add include directives for the Galileo components to the top of the app.py file.
Start a Galileo session.
on_chat_start
function in app.py
, add the following code to create a new logging session:external_id
to the current Chainlit session ID. Each separate conversation in Chainlit is a separate session with a unique ID.Create a callback handler.
Pass the callback handler to LangGraph.
main
function, replace this line:RunnableConfig
that is passed when the supervisor agent is used.Run the app.
View the session in Galileo.
Select the single session.
Ask the bot a follow up question related to credit cards, such as 'Which card has no annual fee?'
Follow this up with a third question that does not involve specific information about the credit cards, such as 'What does APR stand for?'
View the session in the Galileo Console.
Navigate to the last trace.