AGI Core Architecture
agi_core packages the building blocks that every Streamlit page, CLI entry
point, and worker relies on. This page maps the internals so you know where to
plug new logic in—or where a behaviour is defined before drilling into the
codebase.
Modules at a glance
Streamlit/CLI entry points call into agi_core before handing work to agi_env and agi_cluster.
src/agilab/core/agi-core ships the following higher-level domains:
agi_core.appsHelper mixins for app metadata, dataset manifests, and path helpers that every
<app>_projectimports. If you add a new manager or need an app to opt-in to common validation, start here.agi_core.streamlitShared Streamlit widgets (status panels, history view, deploy dialogs) used by EXECUTE/EXPLORE/EDIT. Keeping them here avoids circular imports from the page packages.
agi_core.telemetryStructured logging, run-history helpers, and wrappers used by
AGI.runto emit consistent events back to Streamlit and the CLI mirrors.agi_core.servicesSmall utility services (encryption, local cache, dataset registry) designed to be reused by both the GUI and the app installers.
Execution flow
Streamlit pages talk to agi_core services before dispatching work to
agi_env/agi_cluster.
Generated from pyreverse to show how agi_core orchestrates calls to
agi_env helpers and dispatcher facades.
Typical call stack when a user clicks RUN on the EXECUTE page:
src/agilab/pages/▶️ EXECUTE.pycollects form values and callsagi_core.apps.loader.build_work_plan.agi_core.appsbuilds anAppManifestand passes it toframework_api.AGILabSession.framework_apiwraps the call toAGI.run(orAGI.get_distrib) whileagi_core.telemetrystarts a streamed log section.AGI.run(from Framework API) calls intoagi_envto materialise the environment, then hands control toagi_cluster.agi_distributor.Workers report status via
agi_core.telemetryso Streamlit widgets update in place.
A page/CLI handler receives the user request and immediately resolves an
AgiEnvinstance (handled in AGILab).The page calls into
agi_corefacades (for exampleagi_core.apps.loader) to build the app manifest and correspondingWorkDispatchersettings.agi_core.telemetrystructures the request context and streams it back to the UI whileAGI.runexecutes.Results propagate back through
agi_corehelpers (history, downloads, dataset movers) before the UI renders the finished run.
Repository pointers
Directory |
Purpose |
|---|---|
|
Metadata helpers shared by |
|
Widgets, layout templates, and modal logic for EXECUTE/EXPLORE. |
|
Structured logging, status persistence, and run history APIs. |
|
Standalone service objects (encryption, caching, dataset registry). |
Tips for contributions
Keep business logic for a specific app inside
src/agilab/apps/<app>—only move code intoagi_corewhen multiple apps/pages need the abstraction.When adding a new Streamlit widget, place it under
agi_core/streamlitand export it through a small__all__. That keeps import graphs manageable.agi_corehas no hard dependency onagi_envoragi_cluster. If your change requires environment or dispatcher behaviour, extract a thin interface and inject the dependency so unit tests stay fast.
See also
Framework API for the high-level
AGI.*orchestration entry points.AGILab for the user-facing Streamlit pages built on top of
agi_core.AGILab Architecture for the full-stack overview (pages → agi_core → agi_env/cluster).