feat: add multi analytics database routing for SQL and introspection#8
Open
mjalalimanesh wants to merge 3 commits intoagno-agi:mainfrom
Open
feat: add multi analytics database routing for SQL and introspection#8mjalalimanesh wants to merge 3 commits intoagno-agi:mainfrom
mjalalimanesh wants to merge 3 commits intoagno-agi:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds optional analytics database routing for SQL and schema introspection while preserving original behavior when no analytics env vars are configured.
What changed
db/config.pywith:get_internal_db_url()get_analytics_registry()get_analytics_descriptions()has_explicit_analytics_dbs()dash/tools/sql.py.dash/tools/introspect.pyto use the same routing model.dash/agents.pywiring:AVAILABLE DATABASESsection is shown only when explicit analytics DBs are configureddatabasemetadata handling in semantic/business context and bundled F1 metadata JSON.dash/scripts/load_data.pyrouting behavior:--databaseREADME.md,compose.yaml, andexample.env.Behavior and compatibility
Backward compatible default path:
ANALYTICS_DB_*vars are set, Dash behaves as single-DB mode and uses internalDB_*DB as analytics source.Multi-DB mode:
databaseis required for SQL/introspection tool calls.DB_* variables are for Dash’s internal database only (knowledge, learnings, and AgentOS state).
Analytics query targets are configured separately with ANALYTICS_DB_=<sqlalchemy_url> and optional ANALYTICS_DB__DESC=.
Examples:
Behavior:
Security model