File size: 449 Bytes
e9e7273
 
50a305b
 
e9e7273
 
 
 
50a305b
 
 
e9e7273
50a305b
e9e7273
50a305b
 
e9e7273
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# dashboard/logs.py

import streamlit as st
import pandas as pd
import os
import sqlite3

DB_PATH = os.path.join("/tmp", "memory.db")

def show_logs():
    st.header("πŸ“Š Agent Memory Logs")
    conn = sqlite3.connect(DB_PATH)
    df = pd.read_sql("SELECT * FROM agent_logs ORDER BY timestamp DESC", conn)
    conn.close()
    st.dataframe(df)
    csv = df.to_csv(index=False).encode()
    st.download_button("πŸ“₯ Download Logs", csv, "logs.csv")