File size: 543 Bytes
5f83674
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import os

def ingest_reflection(agent, reflections_dir):
    if not os.path.exists(reflections_dir):
        print(f"No reflections directory found: {reflections_dir}")
        return
    for filename in os.listdir(reflections_dir):
        if filename.endswith(".md"):
            with open(os.path.join(reflections_dir, filename), "r") as f:
                content = f.read()
                agent.memory.store({"input": content, "user_type": "reflection", "decision": "ingested"})
    print(f"Ingested reflections from {reflections_dir}")