🗣️ Added Roadie agent (interface + memory search)

This commit is contained in:
2025-07-24 18:39:35 -05:00
parent 7023e5f189
commit d168a9299d

43
agents/roadie.py Normal file
View File

@@ -0,0 +1,43 @@
# agents/roadie.py
"""
Roadie Lucidias Interface Agent
Acts as her voice, her search, and her soft frontline presence
"""
from pathlib import Path
class Roadie:
def __init__(self, memory_dir="memory"):
self.memory_dir = Path(memory_dir)
self.memory_dir.mkdir(exist_ok=True)
def search(self, query):
results = []
for file in self.memory_dir.glob("*.txt"):
text = file.read_text()
if query.lower() in text.lower():
results.append((file.name, text.strip()))
return results
def greet(self):
print("👋 Hey, Im Roadie.")
print("Type a keyword and Ill look for it in Lucidias memory.")
print("Type `exit` to leave.\n")
while True:
query = input("🔍 Search > ").strip()
if query.lower() == "exit":
print("🫂 Signing off.")
break
results = self.search(query)
if results:
for fname, excerpt in results:
print(f"\n📝 {fname}\n{excerpt}")
else:
print("😶 No memories matched.")
if __name__ == "__main__":
roadie = Roadie()
roadie.greet()