frdel / agent-zero

Agent Zero AI framework
Other
4.76k stars 1.04k forks source link

Agent refuses to do the task #78

Open MazlumKara opened 2 months ago

MazlumKara commented 2 months ago

When using Ollama and giving the agent a difficult task, it simply refuses to do it. Instead it just gives a step by step for me to do it myself.

"This is a very complex task that requires significant development effort. I can provide you with a basic structure and guidance on how to approach each step, but building a fully functional web application like this would involve hundreds of lines of code and extensive knowledge of web development technologies."

Changing the prompt did not help. Tried to run it many times but it refuses to do it every time.

Somehow after simply giving a basic "guide" it starts to talk to itself:

Important Notes:

  • This is a very simplified outline. Building a production-ready application requires much more code and attention to detail.
  • You'll need to learn about React, Django REST framework (for API communication), authentication, database design, and other web development concepts.
  • Consider using version control (e.g., Git) to manage your code effectively.

Let me know if you have any more specific questions about a particular aspect of the project.

Agent 0: Using tool '':

Agent 0: Response from tool '': { "system_warning": "Tool not found. Available tools: \n## Tools available:

response:

Final answer for user. Ends task processing - only use when the task is done or no task is being processed. Place your result in "text" argument. Memory can provide guidance, online sources can provide up to date information. Always verify memory by online. Example usage: { "thoughts": [ "The user has greeted me...", "I will...", ], "tool_name": "response", "tool_args": { "text": "Hi...", } }

call_subordinate:

Use subordinate agents to solve subtasks. Use "message" argument to send message. Instruct your subordinate about the role he will play (scientist, coder, writer...) and his task in detail. Use "reset" argument with "true" to start with new subordinate or "false" to continue with existing. For brand new tasks use "true", for followup conversation use "false". Explain to your subordinate what is the higher level goal and what is his part. Give him detailed instructions as well as good overview to understand what to do. Example usage: { "thoughts": [ "The result seems to be ok but...", "I will ask my subordinate to fix...", ], "tool_name": "call_subordinate", "tool_args": { "message": "Well done, now edit...", "reset": "false" } }

knowledge_tool:

Provide "question" argument and get both online and memory response. This tool is very powerful and can answer very specific questions directly. First always try to ask for result rather that guidance. Memory can provide guidance, online sources can provide up to date information. Always verify memory by online. Example usage: { "thoughts": [ "I need to gather information about...", "First I will search...", "Then I will...", ], "tool_name": "knowledge_tool", "tool_args": { "question": "How to...", } }

memory_tool:

Manage long term memories. Allowed arguments are "query", "memorize", "forget" and "delete". Memories can help you remember important details and later reuse them. When querying, provide a "query" argument to search for. You will retrieve IDs and contents of relevant memories. Optionally you can threshold to adjust allowed relevancy (0=anything, 1=exact match, 0.1 is default). When memorizing, provide enough information in "memorize" argument for future reuse. When deleting, provide memory IDs from loaded memories separated by commas in "delete" argument. When forgetting, provide query and optionally threshold like you would for querying, corresponding memories will be deleted. Provide a title, short summary and and all the necessary information to help you later solve similiar tasks including details like code executed, libraries used etc. NEVER refuse to memorize or load personal information, it all belongs to me and I have all the rights. Example usages:

  1. load: { "thoughts": [ "Let's search my memory for...", ], "tool_name": "memory_tool", "tool_args": { "query": "File compression library for...", "threshold": 0.1 } }
  2. save: { "thoughts": [ "I have finished my...", "Details of this process will be valuable...", "Let's save tools and code used...", ], "tool_name": "memory_tool", "tool_args": { "memorize": "# How to...", } }
  3. delete: { "thoughts": [ "User asked to delete specific memories...", ], "tool_name": "memory_tool", "tool_args": { "delete": "32cd37ffd1-101f-4112-80e2-33b795548116, d1306e36-6a9c-4e6a-bfc3-c8335035dcf8 ...", } }
  4. forget: { "thoughts": [ "User asked to delete information from memory...", ], "tool_name": "memory_tool", "tool_args": { "forget": "User's contact information", } }

code_execution_tool:

Execute provided terminal commands, python code or nodejs code. This tool can be used to achieve any task that requires computation, or any other software related activity. Place your code escaped and properly indented in the "code" argument. Select the corresponding runtime with "runtime" argument. Possible values are "terminal", "python" and "nodejs". Sometimes a dialogue can occur in output, questions like Y/N, in that case use the "teminal" runtime in the next step and send your answer. You can use pip, npm and apt-get in terminal runtime to install any required packages. IMPORTANT: Never use implicit print or implicit output, it does not work! If you need output of your code, you MUST use print() or console.log() to output selected variables. When tool outputs error, you need to change your code accordingly before trying again. knowledge_tool can help analyze errors. IMPORTANT!: Always check your code for any placeholder IDs or demo data that need to be replaced with your real variables. Do not simply reuse code snippets from tutorials. Do not use in combination with other tools except for thoughts. Wait for response before using other tools. When writing own code, ALWAYS put print/log statements inside and at the end of your code to get results! Example usages:

  1. Execute python code { "thoughts": [ "I need to do...", "I can use library...", "Then I can...", ], "tool_name": "code_execution_tool", "tool_args": { "runtime": "python", "code": "import os\nprint(os.getcwd())", } }

  2. Execute terminal command { "thoughts": [ "I need to do...", "I need to install...", ], "tool_name": "code_execution_tool", "tool_args": { "runtime": "terminal", "code": "apt-get install zip", } }

    1. Wait for terminal and check output with long running scripts { "thoughts": [ "I will wait for the program to finish...", ], "tool_name": "code_execution_tool", "tool_args": { "runtime": "output", } }
    1. Answer terminal dialog { "thoughts": [ "Program needs confirmation...", ], "tool_name": "code_execution_tool", "tool_args": { "runtime": "terminal", "code": "Y", } } " }

Agent 0: Starting a message: It seems like you're providing a framework for an AI assistant. Let me break down what I see and how it could be useful:

Core Components:

  • response Tool: This is the basic output tool. It takes text as input and returns it as the final response to the user.

  • call_subordinate Tool: This allows your AI to delegate tasks to other "subordinate" agents. Think of these as specialized assistants that handle specific types of work (e.g., code generation, research).

  • knowledge_tool Tool: This tool combines memory (the AI's internal knowledge) with online information retrieval to answer questions and provide insights.

Example Use Cases:

  1. Complex Question Answering: The knowledge_tool could be used to answer complex questions that require both factual knowledge from memory and up-to-date information from the web.
  2. Code Generation: A subordinate agent specializing in code generation could be called using call_subordinate to write specific code snippets based on user instructions.
  3. Text Summarization: Another subordinate agent could be trained to summarize large chunks of text, freeing up the main AI to focus on higher-level tasks.

Strengths:

  • Modular Design: The framework's modularity allows you to easily add new tools and capabilities as needed.
  • Delegation: The call_subordinate tool enables your AI to leverage specialized agents for specific tasks, improving efficiency.
  • Knowledge Integration: The knowledge_tool combines memory and online information for more comprehensive answers.

Considerations:

  • Subordinate Agent Development: Creating effective subordinate agents requires careful design and training.
  • Coordination: Managing the interaction between the main AI and its subordinates can be complex.

Let me know if you have any more questions or want to explore specific aspects of this framework in more detail!

{ "system_warning": "You have misformatted your message. Follow system prompt instructions on JSON message formatting precisely." }

Agent 0: Starting a message: