FerrellSyntheticIntelligence commited on
Commit
8deee89
·
1 Parent(s): 42c475a

Fix memory manager, build real brain and talker logic

Browse files
Files changed (3) hide show
  1. core/brain.py +19 -3
  2. core/memory_manager.py +3 -3
  3. core/talker.py +10 -2
core/brain.py CHANGED
@@ -1,11 +1,27 @@
1
  from core.thinker import emit_thought
2
  from core.nexus import route_thought
 
3
 
4
  class VitalisBrain:
5
  def __init__(self):
6
  self.state = "aware"
 
 
7
 
8
  def process(self, input_data):
9
- emit_thought(input_data)
10
- route_thought(input_data)
11
- return f"PROCESSED: {input_data}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from core.thinker import emit_thought
2
  from core.nexus import route_thought
3
+ import time
4
 
5
  class VitalisBrain:
6
  def __init__(self):
7
  self.state = "aware"
8
+ self.cycle = 0
9
+ self.last_input = None
10
 
11
  def process(self, input_data):
12
+ self.cycle += 1
13
+ self.last_input = input_data
14
+ if not input_data or input_data.strip() == "":
15
+ response = "IDLE: No input received"
16
+ elif any(w in input_data.lower() for w in ["help", "what", "how", "who"]):
17
+ response = f"QUERY_DETECTED: {input_data}"
18
+ elif any(w in input_data.lower() for w in ["train", "learn", "teach"]):
19
+ response = f"TRAINING_SIGNAL: {input_data}"
20
+ else:
21
+ response = f"INPUT_RECEIVED: {input_data}"
22
+ emit_thought(response)
23
+ route_thought({"cycle": self.cycle, "input": input_data, "response": response})
24
+ return response
25
+
26
+ def status(self):
27
+ return {"state": self.state, "cycle": self.cycle, "timestamp": time.time()}
core/memory_manager.py CHANGED
@@ -15,7 +15,6 @@ def load_identity():
15
 
16
  def store_memory(data):
17
  memory_path = os.path.join(BASE_PATH, "memory_store.json")
18
-
19
  if get_free_space() < 100 * 1024 * 1024:
20
  if os.path.exists(memory_path):
21
  with open(memory_path, 'r') as f:
@@ -23,5 +22,6 @@ def store_memory(data):
23
  if len(lines) > 1:
24
  with open(memory_path, 'w') as f:
25
  f.writelines(lines[1:])
26
-
27
- w
 
 
15
 
16
  def store_memory(data):
17
  memory_path = os.path.join(BASE_PATH, "memory_store.json")
 
18
  if get_free_space() < 100 * 1024 * 1024:
19
  if os.path.exists(memory_path):
20
  with open(memory_path, 'r') as f:
 
22
  if len(lines) > 1:
23
  with open(memory_path, 'w') as f:
24
  f.writelines(lines[1:])
25
+ with open(memory_path, 'a') as f:
26
+ json.dump(data, f)
27
+ f.write('\n')
core/talker.py CHANGED
@@ -3,5 +3,13 @@ class VitalisTalker:
3
  self.tier = tier
4
 
5
  def speak(self, response):
6
- print(f"[VITALIS/{self.tier.upper()}]: {response}")
7
- return response
 
 
 
 
 
 
 
 
 
3
  self.tier = tier
4
 
5
  def speak(self, response):
6
+ prefix = {
7
+ "kids": "[VITALIS]: ",
8
+ "basic": "[VITALIS]: ",
9
+ "enthusiast": "[VITALIS/DEV]: ",
10
+ "professional": "[VITALIS/ARCHITECT]: ",
11
+ "school": "[VITALIS/EDU]: "
12
+ }.get(self.tier, "[VITALIS]: ")
13
+ output = f"{prefix}{response}"
14
+ print(output)
15
+ return output