|
import sqlite3 |
|
import pandas as pd |
|
import streamlit as st |
|
import os |
|
|
|
DB_PATH = os.path.join("/mnt/data", "memory.db") |
|
|
|
def show_logs(): |
|
|
|
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) |
|
|
|
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" |
|
) |
|
|