Spaces:
Sleeping
Sleeping
Create agentos_core.p
Browse files- agentos_core.p +18 -0
agentos_core.p
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import uuid
|
| 2 |
+
from memory_core import MemoryCore
|
| 3 |
+
from identity_core import create_agent_identity
|
| 4 |
+
from orchestrator import Orchestrator
|
| 5 |
+
|
| 6 |
+
class AgentCore:
|
| 7 |
+
def __init__(self):
|
| 8 |
+
self.agent_id = create_agent_identity()
|
| 9 |
+
self.memory = MemoryCore()
|
| 10 |
+
self.orchestrator = Orchestrator(self)
|
| 11 |
+
print(f"[INIT] Agent {self.agent_id} initialized")
|
| 12 |
+
|
| 13 |
+
def process(self, prompt):
|
| 14 |
+
print(f"[RUN] Processing prompt: {prompt}")
|
| 15 |
+
context = self.memory.recall_context(self.agent_id)
|
| 16 |
+
response = self.orchestrator.route(prompt, context)
|
| 17 |
+
self.memory.learn(self.agent_id, prompt, response)
|
| 18 |
+
return f"Agent {self.agent_id} processed: {prompt}\n→ {response}"
|