"""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()