summaryrefslogtreecommitdiff
path: root/agent.py
diff options
context:
space:
mode:
authorbatsumaru <>2026-09-11 17:39:50 +0900
committerbatsumaru <>2026-09-11 17:39:50 +0900
commitd0bbd8aeea139ca4bf4ed37020c71c60a65f0a95 (patch)
treea369d961de87df23359ad2e8931a04b5cbe6d40a /agent.py
parentc90a0f8ae6ad5d6e07927cd0dc53b345a77494ae (diff)
Added weather, file system, and memory
Diffstat (limited to 'agent.py')
-rw-r--r--agent.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/agent.py b/agent.py
index 816f976..41c7a7b 100644
--- a/agent.py
+++ b/agent.py
@@ -4,6 +4,7 @@ from context import ContextBuilder
from identity import AgentIdentity, UserProfile
from llm import LLM
from tools import ToolRegistry
+from memory import WorkingMemory
class Agent:
@@ -22,14 +23,16 @@ class Agent:
user_profile,
)
- self.messages: list[dict[str, object]] = [
- {
- "role": "system",
- "content": self.context.build_system_prompt(),
- }
- ]
+ self.working_memory = WorkingMemory(
+ objective="Testing working memory",
+ facts=["The user is testing the agent's working memory system."],
+ notes=["This is temporary test data."],
+ )
+
+ self.messages: list[dict[str, object]] = []
def chat(self, user_input: str) -> str:
+
self.messages.append(
{
"role": "user",
@@ -39,7 +42,10 @@ class Agent:
for _ in range(5):
response = self.llm.chat(
- self.messages,
+ self.context.build_messages(
+ self.messages,
+ self.working_memory,
+ ),
tools=self.tools.schemas(),
)