AutonomousAgent / app.py
Mathias Heider
ui: design system + branded shell (agent/ui_theme.py, light theme, brand row, footer)
65f8872
Raw History Blame Contribute Delete
1.78 kB
"""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/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()