crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
18.97k stars 2.61k forks source link

Agents don't know about format of communication with each other #379

Closed aliensouls closed 1 week ago

aliensouls commented 5 months ago

I noticed the agents are trying to talk to each other in JSON and then are getting stuck in "I cannot communicate with the other agent because the format is incorrect", it seems like the part needs improvement and specific instruction about how they should delegate tasks, here are my log example verbatim, the agent was in some loop and didn't knew how to delegate (but in many other occasions it succeeds, so it's random):

Output: Due to repeated technical difficulties and the inability to use the tools provided to gather necessary information and examples from the Verse programming language Researcher, I am unable to enhance the provided example code with advanced Verse programming concepts or provide proof from the documentation that confirms that any additions would be syntactically valid and conceptually correct. My attempts to delegate work and ask questions have resulted in consistent errors, indicating that the action inputs were not recognized as valid key-value dictionaries, despite appearing to adhere to JSON standards. Therefore, without further information or the ability to use the tools successfully, I cannot complete the task as originally requested.

here is full log from crew output:


Thought: I need to correct the input format for the action to match the required key-value dictionary structure. Let's fix the JSON formatting and reattempt the delegation.

Action: Delegate work to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "task": "Provide detailed examples and explanations for advanced Verse programming concepts such as structured concurrency, unstructured concurrency, tasks, and the use of specifiers and attributes. Explain how these concepts can be applied to enhance the example code provided, which is a simple text-based game loop.",
  "context": "The example code currently uses basic control flow constructs like block, if, case, loop, break, and defer. We need to understand how to implement advanced Verse programming language features to improve the code. These features should be explained in detail, with syntax and rules, and show how they 
can be integrated into the example code to make it more robust, efficient, or feature-rich. The explanation should include documented examples from the Verse programming language reference to ensure that the implementation is syntactically valid and conceptually correct."
}

Thought: There seems to be a misunderstanding in how to format the JSON for the action input. I must ensure that the JSON dictionary is correctly formatted according to the specifications given. It seems that the system is expecting a proper dictionary with strings enclosed in double quotes and with valid JSON syntax.

Action: Delegate work to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "task": "Provide detailed examples and explanations for advanced Verse programming concepts such as structured concurrency, unstructured concurrency, tasks, and the use of specifiers and attributes. Explain how these concepts can be applied to enhance the example code provided, which is a simple text-based game loop.",
  "context": "The example code currently uses basic control flow constructs like block, if, case, loop, break, and defer. We need to understand how to implement advanced Verse programming language features to improve the code. These features should be explained in detail, with syntax and rules, and show how they 
can be integrated into the example code to make it more robust, efficient, or feature-rich. The explanation should include documented examples from the Verse programming language reference to ensure that the implementation is syntactically valid and conceptually correct."
}

Thought: The error in my previous attempts indicates that there is an issue with the JSON formatting of my action input. I need to ensure that the input I provide is a valid key-value dictionary with proper JSON syntax, meaning that the keys and string values must be in double quotes and the entire structure must adhere to JSON standards. I will carefully format the JSON dictionary for the action input and try again.

Action: Delegate work to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "task": "Research and provide detailed examples and explanations for advanced Verse programming concepts that could be integrated into the existing simple 
text-based game loop code to make it more robust and efficient. Focus on concepts such as structured concurrency (sync, race, rush), unstructured concurrency (spawn), tasks, and the use of specifiers and attributes. Ensure examples are syntactically valid and conceptually correct according to the Verse programming language documentation.",
  "context": "The provided example code uses basic control flow constructs such as 'block', 'if', 'case', 'loop', 'break', and 'defer'. We need to enhance it with advanced features from the Verse programming language. The goal is to improve the code's functionality or performance, and demonstrate a thorough understanding of these advanced concepts by applying them correctly and providing justification for their use, backed by documentation."
}

Thought: It seems that my previous attempts to delegate work failed due to an incorrect action input format. I need to ensure that the action input is a valid Python dictionary with strings enclosed in double quotes. I will revise the action input to form a proper dictionary and ensure that the "task" and "context" fields are clearly defined and contain all necessary information for the Verse programming language Researcher to understand the assignment.

Action: Delegate work to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "task": "Identify and explain advanced or unusual and difficult concepts in the Verse programming language that can be applied to the given example code to enhance it. Provide proof from the documentation that confirms that these concepts are syntactically valid and conceptually correct.",
  "context": "The current example code demonstrates basic control flow constructs like block, if, case, loop, break, and defer in a simple text-based game loop. We need to integrate more advanced Verse programming concepts into this code. Specifically, we are interested in structured concurrency (sync, race, rush), unstructured concurrency (spawn), tasks, and the use of specifiers and attributes. These concepts should be explained in detail, including their syntax and rules, and how they can be applied to improve the example code's robustness, efficiency, or feature-richness. The explanation must be backed with documented examples from the provided Verse programming language reference to ensure the implementation is correct."
}
```Thought: 
I seem to have misunderstood the instructions regarding the formatting of the action input. I need to ensure that the JSON dictionary is formatted correctly 
with proper syntax and structure. Let's try a different approach using the appropriate JSON dictionary format with all keys and values wrapped in double quotes.

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Research and explain advanced or unusual and difficult Verse programming concepts that could be applied to the example code provided. This should 
include concepts such as structured concurrency (using sync, race, rush), unstructured concurrency (using spawn), tasks, specifiers and attributes. The goal 
is to enhance the simple text-based game loop code with these advanced features.",
  "context": "The current example code makes use of basic control flow constructs such as block, if, case, loop, break, and defer. We need to integrate advanced features from the Verse programming language to make the code more efficient or to add new functionalities. These advanced concepts need to be explained 
in detail, with their syntax and rules clearly outlined, and how they can be applied to the example code. It is crucial to reference the provided Verse programming language documentation to ensure that the implementation is syntactically valid and conceptually correct."
}
```Thought: 
I seem to be facing a persistent issue with the formatting of the action input for delegating work to the Verse programming language Researcher. The system requires a valid dictionary with keys and values wrapped in double quotes, formatted as proper JSON. I need to carefully check the JSON structure to ensure it is correct and retry the action.

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Examine the provided Verse programming language reference and explain advanced or unusual and difficult concepts that can be added to the example 
code. Focus on structured concurrency (sync, race, rush), unstructured concurrency (spawn), tasks, and the use of specifiers and attributes.",
  "context": "The existing example code uses basic control flow constructs. We aim to enhance it by integrating advanced Verse programming language features. The explanation should include detailed syntax and rules for these advanced concepts and documented proof from the Verse programming reference to ensure the additions are syntactically and conceptually correct."
}
```Thought: 
It appears that I am repeatedly encountering errors when trying to delegate work to the Verse programming language Researcher. The system is not accepting my action inputs despite my attempts to correct them. To proceed, I must carefully assess the requirements for a valid key-value dictionary and ensure that I am adhering to the proper JSON format. I need to make sure that the keys and values are correctly wrapped in double quotes and that no invalid characters or syntax errors are present. Let's attempt to revise and simplify the action input while maintaining all necessary context for the task.

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Review the Verse programming language reference to identify advanced concepts that can be integrated into the example code to enhance it. These concepts could include structured and unstructured concurrency, tasks, and specifiers and attributes.",
  "context": "The current example code is a simple text-based game loop using basic control flow constructs like block, if, case, loop, break, and defer. We 
need to add advanced programming features from Verse to improve the code's functionality and performance. Please explain the advanced concepts, their syntax, how to apply them, and provide documentation proof to confirm their correctness."
}
```Thought: It appears there has been a consistent issue with the formatting of the action inputs for delegation, despite my attempts to craft a correctly formatted JSON dictionary. I need to reassess and simplify the input without compromising the necessary details required for the Verse programming language Researcher to understand and complete the task.

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Identify advanced concepts in the Verse programming language and explain how to integrate them into the provided example code. These concepts may 
include structured concurrency, unstructured concurrency, tasks, specifiers, and attributes.",
  "context": "The example code is a simple text-based game loop using basic control flow constructs. The goal is to enhance this code with advanced Verse features. Provide detailed explanations, including syntax, application methods, and documentation evidence to ensure correctness."
}
```Thought: There seems to be a consistent error in my attempts to delegate work to the Verse programming language Researcher, despite trying various phrasings and ensuring the input is in a JSON dictionary format. It's possible that the tool requires a very specific format that I have not yet met. To move forward, I will analyze the instructions again and attempt to simplify the input further, ensuring all details are correct and that the format strictly follows JSON standards.

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Examine the provided Verse programming language reference for advanced concepts and explain how they can be applied to the provided example code to enhance it. These should include, but not be limited to, structured concurrency (sync, race, rush), unstructured concurrency (spawn), tasks, and the use of specifiers and attributes.",
  "context": "The given example code uses basic control flow constructs. We need to enrich it with advanced Verse programming language features to improve efficiency and functionality. The explanation should include detailed syntax and rules, how these concepts can be practically applied to the code, and documented proof from the Verse programming language reference to confirm that the implementation is syntactically and conceptually correct."
}
```Thought: 
Despite multiple attempts, I've been unable to provide a correctly formatted action input that the system accepts. My primary objective is to enhance the existing example code with advanced Verse programming concepts. I need to reassess the information required by the Verse programming language Researcher and how it should be structured in the action input. It's crucial that the action input be a valid JSON dictionary with keys and values wrapped in double quotes and no syntax errors. I will now simplify the action input to its most basic elements while still providing all the necessary context for the task at hand.     

Action: Delegate work to co-worker

Action Input:
```json
{
  "coworker": "Verse programming language Researcher",
  "task": "Identify and explain advanced concepts in the Verse programming language that can be integrated into the example code to enhance its functionality or efficiency.",
  "context": "The example code provided is a simple text-based game loop that currently uses basic control flow constructs. To improve this code, we need to 
add advanced features from the Verse programming language. These may include structured concurrency, unstructured concurrency, tasks, and the use of specifiers and attributes. The explanation should detail how to apply these concepts to the example code and must include documented proof from the Verse programming language reference to ensure the implementation is syntactically and conceptually correct."
}

Thought: Given the persistent issues with the action inputs and the errors indicating that the input is not a valid key, value dictionary, it appears there has been a fundamental misunderstanding or technical issue with the provided tool. The JSON formatting seems to be correct, with keys and values wrapped in double quotes, as per JSON standards. However, the system has not accepted any of the attempts. It may be necessary to simplify the task and context to their most basic form to meet the tool's requirements, ensuring all necessary details are included for the Verse programming language Researcher to complete the task.

Action: Delegate work to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "task": "Examine the Verse programming language reference and explain advanced concepts that can be applied to the provided example code, which is a simple text-based game loop.",
  "context": "The goal is to enhance the example code with advanced programming features such as structured concurrency, unstructured concurrency, tasks, specifiers, and attributes. Please detail the syntax and application of these concepts and provide documented proof from the Verse programming language reference to confirm their correctness."
}

Thought: Despite my efforts to format the action input correctly, I've faced repeated errors indicating that the input is not a valid key-value dictionary. There seems to be a disconnect between the expected format and the inputs I've been providing. However, I've reached the limit of the tools I can use, and I must adhere to the constraints given. Therefore, I will now take a different approach to gather information from a co-worker using the 'Ask question to co-worker' tool.

Action: Ask question to co-worker

Action Input:

{
  "coworker": "Verse programming language Researcher",
  "question": "Can you provide a detailed explanation of advanced Verse programming concepts such as structured concurrency, unstructured concurrency, tasks, and the use of specifiers and attributes, and how they can be applied to enhance a simple text-based game loop code?",
  "context": "I am looking to improve an example code that consists of a simple text-based game loop using basic control flow constructs like block, if, case, loop, break, and defer. The objective is to integrate advanced Verse programming language features to make the code more robust and efficient. Please include examples and explanations using the provided Verse programming language reference documentation."
}

Thought: After multiple attempts to delegate work and ask questions to my co-workers using the provided tools, I have faced consistent errors and have been unable to gather additional information or examples of advanced Verse programming concepts. Without the input from the Verse programming language Researcher and without access to the Verse programming language reference document, I cannot confidently enhance the provided example code with advanced features or confirm that any such enhancements would be syntactically valid and conceptually correct. Therefore, based on the tools and information available to me, I must conclude my response.

Final Answer: Due to repeated technical difficulties and the inability to use the tools provided to gather necessary information and examples from the Verse programming language Researcher, I am unable to enhance the provided example code with advanced Verse programming concepts or provide proof from the documentation that confirms that any additions would be syntactically valid and conceptually correct. My attempts to delegate work and ask questions have resulted in consistent errors, indicating that the action inputs were not recognized as valid key-value dictionaries, despite appearing to adhere to JSON standards. Therefore, without further information or the ability to use the tools successfully, I cannot complete the task as originally requested.

Finished chain.

this is output of callback function (what these agents are doing is to try and write examples in Verse programming language from Epic games, based on scraped docs and the website docs) ->>


    [Advanced example completed]
    -################################################
        Output: Due to repeated technical difficulties and the inability to use the tools provided to gather necessary information and examples from the 

Verse programming language Researcher, I am unable to enhance the provided example code with advanced Verse programming concepts or provide proof from the documentation that confirms that any additions would be syntactically valid and conceptually correct. My attempts to delegate work and ask questions have resulted in consistent errors, indicating that the action inputs were not recognized as valid key-value dictionaries, despite appearing to adhere to JSON standards. Therefore, without further information or the ability to use the tools successfully, I cannot complete the task as originally requested. -################################################

euler007 commented 5 months ago

I get the same issue too, I initially though it is an llm issue. But after trying multiple llm's I get similar results. Not sure why this happens, however please let me know in case you or anyone else finds the solution.

I get the following error Action 'Delegate work to Directory Reader' don't exist, these are the only available Actions: Delegate work to co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following co-workers: ['Overseer', 'Directory Reader', 'File Reader'] The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to exectue the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them. Ask question to co-worker: Ask question to co-worker(coworker: str, question: str, context: str) - Ask a specific question to one of the following co-workers: ['Overseer', 'Directory Reader', 'File Reader'] The input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them.

kyuumeitai commented 4 months ago

This error is frequent at least on local models. The only model that I manage to use is OpenHermes.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 5 days with no activity.