Tpayne101 commited on
Commit
61c7873
·
verified ·
1 Parent(s): 9ca0bca

Create memory_viewer.py

Browse files
Files changed (1) hide show
  1. memory_viewer.py +17 -0
memory_viewer.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import json, os
3
+
4
+ def view_memory():
5
+ # Check if your agent's memory file exists
6
+ if os.path.exists("data/memory.json"):
7
+ with open("data/memory.json", "r") as f:
8
+ return json.dumps(json.load(f), indent=2)
9
+ return "No memory data yet."
10
+
11
+ memory_tab = gr.Interface(
12
+ fn=view_memory,
13
+ inputs=[],
14
+ outputs="text",
15
+ title="🧠 Memory Viewer",
16
+ description="View stored memories and personality data from your agent."
17
+ )