Problem: Text-to-SQL AI tools score 85–90% on clean benchmark databases but drop to 17–21% accuracy on real enterprise schemas. The failure isn't model quality, it's missing business context. Real databases have column names like `ordervault`, `userstamp`. No LLM can infer what these mean from names alone. Worse, the same column name like `channel` or `status` means completely different things in different tables. The result is SQL that is syntactically valid but semantically wrong. Solution: DataSage connects to a PostgreSQL database and produces a **Context Pack** — a versioned, portable, machine-readable semantic layer stored as JSON containing: - Business-language purpose for every table - Per-column meanings — what the column actually represents - FK-backed relationships (no heuristic inference) - Ambiguity flags for columns that share a name but mean different things across tables - Schema drift detection Working: Read-only DB role, up to 8 sample rows per table, PII masking before anything reaches an AI model. A single CrewAI Business Analyst agent then processes all tables at once, with cross-table column-name collisions pre-computed and injected as a closed checklist. Two artifacts: `context_pack.json` and human-readable Markdown documentation. The Context Pack is exposed via an MCP server with three tools: `get_context_pack()`, `query_documentation(table_name)`, and `check_drift()`. Any MCP-compatible client — Claude Desktop, Cursor, or custom agents — can call these and immediately write accurate SQL on schemas they have never seen before. A Streamlit UI handles connect → scan → browse → chat, with a toggle to compare Context Pack mode vs raw schema mode: same question, same model, visibly different SQL quality. Difference: Most tools treat missing business context as a model problem. DataSage treats it as a data problem and solves it at the source. The Context Pack travels with the schema, not with the tool,any agent that can read JSON can use it.
Category tags: