File size: 793 Bytes
723bf9e
50a305b
723bf9e
e9e7273
 
723bf9e
50a305b
 
723bf9e
 
 
 
 
e9e7273
723bf9e
e9e7273
723bf9e
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sqlite3
import pandas as pd
import streamlit as st
import os

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

def show_logs():
    # Ensure DB exists
    if not os.path.exists(DB_PATH):
        st.info("No logs yet β€” run your first pipeline!")
        return

    conn = sqlite3.connect(DB_PATH)
    df = pd.read_sql("SELECT * FROM memory_logs ORDER BY id DESC", conn)
    conn.close()

    if df.empty:
        st.info("No logs yet β€” run your first pipeline!")
    else:
        st.dataframe(df, use_container_width=True)
        # Offer download
        csv = df.to_csv(index=False).encode("utf-8")
        st.download_button(
            label="πŸ“₯ Download Logs CSV",
            data=csv,
            file_name="agent_memory_logs.csv",
            mime="text/csv"
        )