| agent-supervisor |
1.0.0 |
Demonstrate a supervisor-worker architecture for intelligent task delegation and real-time decision-making. |
| name |
description |
| OPENAI_API_KEY |
OpenAI API key for language models. |
|
| name |
description |
| TAVILY_API_KEY |
Tavily API key for search functionality. |
|
|
| step |
action |
details |
| 1 |
Load environment variables. |
Set the OPENAI_API_KEY and TAVILY_API_KEY environment variables. |
|
| step |
action |
details |
| 2 |
Configure LangChain tools. |
Initialize TavilySearchResults and PythonREPLTool. |
|
| step |
action |
details |
| 3 |
Define agent nodes. |
Create functions for the Researcher and Coder agents that process state through their respective tasks. |
|
| step |
action |
details |
| 4 |
Set up supervisor agent. |
Create a supervisor agent function that decides which worker should act next based on user input. |
|
| step |
action |
details |
| 5 |
Build state graph. |
Construct the state graph with nodes for each agent and edges connecting them to the supervisor node. |
|
| step |
action |
details |
| 6 |
Add conditional edges. |
Define conditions for transitioning between agents based on their responses. |
|
| step |
action |
details |
| 7 |
Compile graph. |
Compile the state graph into a runnable workflow. |
|
| step |
action |
details |
| 8 |
Run example queries. |
Stream through the workflow with example inputs to demonstrate its functionality. |
|
|
| name |
description |
| Example 1: Code Hello World |
A demonstration of coding a simple hello world program. |
|
| name |
description |
| Example 2: Research Report |
A demonstration of researching and writing a brief report on pikas. |
|
|
|
|