File size: 1,866 Bytes
11dde75
 
 
 
 
 
 
65f8872
11dde75
 
 
 
 
 
 
65f8872
 
11dde75
 
 
 
65f8872
11dde75
 
 
65f8872
 
 
 
11dde75
 
 
 
 
b5cfe5c
78f2057
11dde75
 
 
 
 
65f8872
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""AIM Composites β€” Autonomous Ingestion Agent Space.

Streamlit shell: navigation + one-time boot (schema, query seeding, background
scheduler). The agent itself lives in agent/orchestrator.py and keeps running
whether or not anyone is viewing the app.
"""
import logging
import os

import streamlit as st

logging.basicConfig(level=logging.INFO,
                    format="%(asctime)s %(levelname)s %(name)s %(message)s")

st.set_page_config(
    page_title="AIM Β· Autonomous Ingestion Agent",
    page_icon="πŸ§ͺ",
    layout="wide",
)

from agent.ui_common import boot  # noqa: E402
from agent import ui_theme  # noqa: E402

boot()  # idempotent: agent schema, default queries, scheduler sync

# --- design system: CSS + altair theme, once per run ------------------------
ui_theme.inject_css()
ui_theme.register_altair_theme()

pages = {
    "": [
        st.Page("page_files/Dashboard.py", title="Dashboard", icon="πŸ“Š", default=True),
        st.Page("page_files/Run_Control.py", title="Run Control", icon="πŸŽ›οΈ"),
        st.Page("page_files/Recently_Added.py", title="Recently Added", icon="πŸ†•"),
        st.Page("page_files/Database.py", title="Database", icon="πŸ—„οΈ"),
        st.Page("page_files/Knowledge_Graph.py", title="Knowledge Graph", icon="πŸ•ΈοΈ"),
        st.Page("page_files/Review_Queue.py", title="Review Queue", icon="πŸ”"),
        st.Page("page_files/Logs.py", title="Runs & Logs", icon="πŸ“œ"),
    ]
}

nav = st.navigation(pages, position="top")

# Elements emitted before .run() render on every page above its content;
# the footer container is emitted before .run() too (so pages that st.stop()
# still get it) and pushed to the bottom with CSS flex `order`.
with st.container(key="aim_brand"):
    ui_theme.brand_row(os.environ.get("DB_NAME", ""))
with st.container(key="aim_footer"):
    ui_theme.footer()

nav.run()