{"id":24653974,"url":"https://github.com/thomassuedbroecker/bee-agent-framework-multi-agent-workflow-example","last_synced_at":"2025-03-21T00:43:03.407Z","repository":{"id":273674676,"uuid":"920502668","full_name":"thomassuedbroecker/bee-agent-framework-multi-agent-workflow-example","owner":"thomassuedbroecker","description":"This is an example based on the Bee Agent Framework in January 2025.","archived":false,"fork":false,"pushed_at":"2025-02-14T18:09:52.000Z","size":21966,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T18:35:20.042Z","etag":null,"topics":["bee-agent-framework","multiagent","watsonx"],"latest_commit_sha":null,"homepage":"https://github.com/i-am-bee/bee-agent-framework/blob/main/examples/workflows/multiAgents.ts","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomassuedbroecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T09:12:40.000Z","updated_at":"2025-02-14T18:09:55.000Z","dependencies_parsed_at":"2025-01-22T10:36:44.938Z","dependency_job_id":null,"html_url":"https://github.com/thomassuedbroecker/bee-agent-framework-multi-agent-workflow-example","commit_stats":null,"previous_names":["thomassuedbroecker/bee-agent-framework-multi-agent-workflow-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomassuedbroecker","download_url":"https://codeload.github.com/thomassuedbroecker/bee-agent-framework-multi-agent-workflow-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717345,"owners_count":20498283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bee-agent-framework","multiagent","watsonx"],"created_at":"2025-01-25T21:14:37.338Z","updated_at":"2025-03-21T00:43:03.401Z","avatar_url":"https://github.com/thomassuedbroecker.png","language":"TypeScript","readme":"# Run an example multi-agent workflow with Bee Agents and watsonx\n\nThis repository was built on the [Bee Agent Framework Starter]() repository. The starter template lets you quickly start working with the [Bee Agent Framework](https://github.com/i-am-bee/bee-agent-framework) in a second. \n\nThe repository as a starting point for multi-agents with the coding from the [MultiAgents](https://github.com/i-am-bee/bee-agent-framework/blob/main/examples/workflows/multiAgents.ts) in the [Bee Agent Framework](https://github.com/i-am-bee/bee-agent-framework). \n\nCurrently, on January 20, the [Bee Agent Framework provides experimental workflows](https://i-am-bee.github.io/bee-agent-framework/#/workflows) with a multi-agent configuration running them in a sequence.\n(contains update BeeAgentFramework 0.1.1)\n\nThe following example two questions concerns the weather in New York. \n\nThese example questions for the workflow are only to determine whether two different roles are needed and what response the solver generates with the available input. \n\n* The first question addresses a matter requiring `up-to-date` information, which means that a specialist must formulate a response. \n\n* The second question is designed to require current facts and additional information, which can't be easily found with a search engine on the internet. The goal of the second question is not to obtain a concrete answer but to demonstrate that the combination of a specialist and research is effective and the solver is able to successfully integrate this information. However, it is important to note that humans or agents cannot answer the second question related to this topic quickly. \n\nThese are the two different questions which the workflow should answer:\n\n* \"What is the current weather in New York?\" -\u003e `should be solved only by the specialist`.\n![](images/bee-multiagent-01.gif)\n\n* \"What do you expect based on the current weather and the information related to climate changes for the city of New York? Will there be problems for the next month?\" -\u003e `should be solved by specialist and researcher together`.\n![](images/bee-multiagent-02.gif)\n\nWe will define three agents. Each agent is configured as in the following list:\n\n* `role`\n* `custom instructions`\n* `tools`\n* `execution parameters`\n\nExample code:\n\n```typescript\nworkflow.addAgent({\n name: \"WeatherForecaster\",\n instructions: \"You are a weather assistant. Respond only if you can provide a useful answer.\",\n tools: [new OpenMeteoTool()],\n llm: chatLLM,\n execution: { maxIterations: 10, totalMaxRetries: 10, maxRetriesPerStep: 5 },\n});\n```\n\nThe table contains a high-level overview of the role, the tools, and a short description.\n\n| Role | Tools | Description |\n| --- | --- | --- |\n|  **specialist** WeatherForecaster | `weather tool` |  A **specialist** a WeatherForecaster, here we provide a `weather tool` to get actual weather information. |\n| **researcher** | `DuckDuckGoSearchTool` | A **researcher** who **searches for additional information** in case the specialist knowledge is insufficient, here we provide the DuckDuckGoSearchTool to find additional information online. |\n| **solver** | no tool | A **solver** who is responsible for building the **final output** based on the input result of the specialist and the researcher to create the correct answer for the requester. |\n\nIn our case, all the agents use the same LLM for their internal system prompt for reasoning and the agent chat communication prompt configuration.\n\nThe code follows the steps for implementation.\n\n1. Chat model setup\n2. Workflow creation\n3. Agent definition\n4. Execution with an interactive console input and output\n\nThe console output below is the result for the more complex question:\n\n_Note:_ The execution time depends on the model, inference, network, context size, retry configuration, prompts, and so on; this example configuration is not optimal ;-). \n\n```sh\nnpm run start src/multi_agent_example.ts\n\n\u003e bee-agent-framework-starter@0.0.1 start\n\u003e npm exec tsx src/multi_agent_example.ts\n\n-------\nTo test the configuration you can use the two following questions\n-------\n1. Ask a simple question 👤 : What is the current weather in New York?\n2. Ask a more complex question 👤 : What do you expect based on the current weather and the information related to climate changes for the city of New York? Will there be problems for the next month?\n-------\nInteractive session has started. To escape, input 'q' and submit.\nUser input 👤 : What is the current weather in New York?\n-\u003e WeatherForecaster:  The current weather in New York as of 17:45 on February 14, 2025, is 2.3°C with a relative humidity of 30% and a wind speed of 23.6 km/h.\n-\u003e Researcher:  I don't have the current weather conditions for New York on February 14, 2025. For the most up-to-date and accurate information, I recommend checking a reliable weather website or app.\n-\u003e Solver:  As of 5:56 PM on February 14, 2025, the current weather in New York is 2.3°C with a relative humidity of 30% and a wind speed of 23.6 km/h, according to the WeatherForecaster.\n--------\nAgent 🤖 As of 5:56 PM on February 14, 2025, the current weather in New York is 2.3°C with a relative humidity of 30% and a wind speed of 23.6 km/h, according to the WeatherForecaster.\n\n-\u003e The time to answer the question the LLMs took 34.678531167 seconds.\n\nUser input 👤 : What do you expect based on the current weather and the information related to climate changes for the city of New York? Will there be problems for the next month?\n-\u003e WeatherForecaster:  For the next month in New York, the temperature is expected to fluctuate, with highs ranging from 0.4°C to 12°C and lows ranging from -6.6°C to 0.9°C. There will be some precipitation, with the most significant amount (31 mm) on February 16. Potential problems related to climate change include extreme temperature fluctuations and increased precipitation, which can lead to flooding and disrupted daily life. However, this forecast only goes until March 1, so it's essential to continue monitoring the weather for the rest of the month.\n-\u003e Researcher:  For the next month in New York, the temperature is expected to fluctuate, with highs ranging from 0.4°C to 12°C and lows ranging from -6.6°C to 0.9°C. There will be some precipitation, with the most significant amount (31 mm) on February 16. Potential problems related to climate change include extreme temperature fluctuations and increased precipitation, which can lead to flooding and disrupted daily life. According to the National Weather Service's Climate Prediction Center, there is a likelihood of above-average temperatures in February 2025. Additionally, AccuWeather's 2025 U.S. Spring Forecast predicts that spring warmth will expand across the southern and central U.S., while the northern states will experience a chilly transition. It's essential to continue monitoring the weather for the rest of the month, as forecasts can change.\n-\u003e Solver:  Based on the current weather conditions and climate change trends, for the next month in New York, you can expect fluctuating temperatures, with highs ranging from 0.4°C to 12°C and lows ranging from -6.6°C to 0.9°C, and some precipitation, with the most significant amount (31 mm) on February 16. Potential problems related to climate change include extreme temperature fluctuations and increased precipitation, which can lead to flooding and disrupted daily life. It's essential to continue monitoring the weather for the rest of the month, as forecasts can change.\n--------\nAgent 🤖 Based on the current weather conditions and climate change trends, for the next month in New York, you can expect fluctuating temperatures, with highs ranging from 0.4°C to 12°C and lows ranging from -6.6°C to 0.9°C, and some precipitation, with the most significant amount (31 mm) on February 16. Potential problems related to climate change include extreme temperature fluctuations and increased precipitation, which can lead to flooding and disrupted daily life. It's essential to continue monitoring the weather for the rest of the month, as forecasts can change.\n\n-\u003e The time to answer the question the LLMs took 107.85920366699999 seconds.\n```\n\n# Changes in the configuration\n\nThis is an early first try using watsonx AI with a chat configuration in this context. In this context, we will use only the [WatsonxChatLLM](https://i-am-bee.github.io/bee-agent-framework/#/llms) and not the combination of WatsonXLLM and [WatsonxChatLLM](https://i-am-bee.github.io/bee-agent-framework/#/llms) because the basic LLM configuration is no longer needed.\n\nThe example code shows the remaining needed code for the configuration.\n\n```typescript\nconst chatLLM = new WatsonxChatModel(\n  \"meta-llama/llama-3-3-70b-instruct\"\n)\n\nchatLLM.parameters.maxTokens = 500\nchatLLM.parameters.temperature = 1\n```\n\n📚 See the [documentation](https://i-am-bee.github.io/bee-agent-framework/) to learn more.\n\n## Prerequisites\n\n- JavaScript runtime [NodeJS \u003e 18](https://nodejs.org/) (ideally installed via [nvm](https://github.com/nvm-sh/nvm)).\n\n## Run the examples\n\n1. Clone this repository\n2. Install dependencies \n\n```sh\nnpm ci\nnpm install @ibm-cloud/watsonx-ai\n``` \n3. Configure your project by filling in missing values in the `.env` file for watsonx.\n\n```sh\ncat .env_template \u003e .env\n```\n\n4. Relevant entries.\n\n```sh\n## WatsonX\nexport WATSONX_API_KEY=\"\"\nexport WATSONX_PROJECT_ID=\"\"\nexport WATSONX_REGION=\"us-south\"\nexport WATSONX_CHAT_MODEL=\"meta-llama/llama-3-3-70b-instruct\"\n# export WATSONX_EMBEDDING_MODEL=\"\"\n# export WATSONX_PROJECT_ID=\"\"\n# export WATSONX_SPACE_ID=\"\"\n# export WATSONX_VERSION=\"\"\n```\n\n5. Run the agents\n\n```sh\nnpm run start src/multi_agent_example.ts\n```\n\n🧪 More examples can be found [here](https://github.com/i-am-bee/bee-agent-framework/blob/main/examples).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomassuedbroecker%2Fbee-agent-framework-multi-agent-workflow-example/lists"}