Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

3.0 KB
Raw Blame

Multi Agent Collaboration

This example resembles the example from following cookbook.

There are two implementations:

  1. hamilton/ -- this uses Hamilton inside the defined actions.
  2. lcel/ -- this uses LangChain's LCEL inside the defined actions.

hamilton/application.py vs lcel/application.py:

  • They should be functionally equivalent, except that langchain uses deprecated openai function constructs underneath, while Hamilton uses the non-deprecated tool calling constructs.
  • Compare the two examples to see the code. Burr however doesn't change.

show me the prompts

With Hamilton the prompts can be found in the moduel hamilton/func_agent.py.

With LangChain that's difficult. You'll need to dive into their code to see what ends up being sent.

Tracing

You'll see that both hamilton/application.py and lcel/application.py have some lightweight tracing set up. This is a simple way to plug into Burr's tracer functionality -- this will allow you to see more in the Burr UI.

More functionality is on the roadmap!

Running the example

Install the dependencies:

pip install "apache-burr[start]" -r requirements.txt

Make sure you have the API Keys in your environment:

export OPENAI_API_KEY=YOUR_KEY
export TAVILY_API_KEY=YOUR_KEY

To run the example, you can do:

Run the notebook: Open In Colab

python hamilton/application.py

Application run: hamilton image

or

Run the notebook: Open In Colab

python lcel/application.py

Application run: lcel image