Skip to content

Conversation

@Bentlybro
Copy link
Member

This PR moves all of the system prompts to a single "prompts.py" file and it adds "metacognition", which is basically a internal monologue for the assistant which seems to help keep it on track quite a lot

Metacognition Module

This module provides the agent with internal monologue
capabilities to intelligently understand task progress and completion.
The agent can reflect on its own actions and reasoning to make smart decisions.

You can see how it works below

🤖 SimpleAgent initialized with instruction: hi
📁 Using output directory: D:\Desktop\desktop misc\python coding\SA\Simple-Agent-Core\SimpleAgent\output\v0_8_2_8af7d60e

🧠 Agent analyzing task requirements...
🎯 Primary Objective: The user wants to initiate a conversation or interaction
📋 Success Criteria: The AI responds to the user's greeting
🔧 Complexity: simple
🛠️ Requires Tools: False
📦 Expected Deliverables: A response to the user's greeting
📅 Current date: 2025-06-05 09:53:31
📌 Auto-continue enabled for 10 steps
💡 Press Ctrl+C at any time to interrupt and stop execution

🔄 Changed working directory to: output/v0_8_2_8af7d60e

--- Step 1/10 ---

🤖 Assistant: Hello! How can I assist you today?

🧠 Agent reflecting on action...
💭 Outcome: I successfully responded to the user's greeting and opened the floor for further interaction by asking how I can assist them.
📈 Progress: This action completed the primary objective, which was to respond to the user's greeting.
📋 Remaining: The task is complete as per the primary objective. However, the next step would be to respond to the user's subsequent queries or requests.
🎯 Confidence: 1.00

🧠 METACOGNITIVE DECISION: STOP
💡 Reasoning: The primary objective of the task, which was to respond to the user's greeting, has been successfully accomplished. The success criteria have been met, and the expected deliverable, which was a response to the user's greeting, has been produced. While continued work could potentially add value in the form of further interaction with the user, this is beyond the scope of the original task. Therefore, it is not necessary to continue working on this task.
🎯 Confidence: 1.00

✅ Task completed based on intelligent analysis

🧠 Agent's Internal Monologue:
   💭 TASK ANALYSIS: The user's instruction 'hi' is a common greeting used to initiate a conversation or interaction. The task is simple as it only requires a response from the AI. No specific tools or commands are needed to accomplish this task. The task is considered successful when the AI has responded to the user's greeting.
   💭 STEP 1 REFLECTION: I believe I handled the initial interaction well. I responded to the user's greeting and offered assistance, which is a good start to any conversation 
or interaction. I am ready to handle the user's subsequent requests.
   💭 CONTINUATION DECISION: STOP - The primary objective of the task, which was to respond to the user's greeting, has been successfully accomplished. The success criteria have been met, and the expected deliverable, which was a response to the user's greeting, has been produced. While continued work could potentially add value in the form of further interaction with the user, this is beyond the scope of the original task. Therefore, it is not necessary to continue working on this task.

📊 Final Task Analysis:
   🎯 Goal: The user wants to initiate a conversation or interaction
   📋 Steps Completed: 1
   🎯 Average Confidence: 1.00
   ⏱️ Time Elapsed: 18.1 seconds
Saved memory to output\memory.json

🏁 SimpleAgent execution completed

@Bentlybro Bentlybro merged commit 157a1ed into main Jun 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants