Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: CausalInferenceLab/Lang2SQL
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: CausalInferenceLab/Lang2SQL
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/harness-semantic-tui
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 57 files changed
  • 2 contributors

Commits on Apr 17, 2026

  1. feat: add v3 agentic harness with semantic layer, tools, viz, and TUI

    Transform lang2sql from a pipeline-based NL→SQL library into an
    interactive data analysis agent. The LLM decides which tools to call
    (ReAct pattern) instead of following a fixed pipeline sequence.
    
    New packages:
    - harness/: async generator agent loop, Tool protocol, ToolRegistry,
      Session state, dynamic system prompt builder
    - semantic/: Metric, Dimension, Relationship, BusinessRule types;
      SemanticLayer CRUD + search; SQLComposer (semantic→SQL with
      auto-JOIN, WHERE, GROUP BY); JSON persistence
    - tools/: 13 tools (explore_schema, run_sql, write_sql, profile_table,
      search_semantic, define_metric, define_dimension, explain_query,
      write_code, run_code, visualize, ask_user, show_plan)
    - viz/: intent-based chart selection, plotext terminal charts,
      Rich tables, Plotly HTML export
    - tui/: Textual-based OpenCode-style terminal UI with schema browser,
      conversation streaming, plan approval, inline charts
    
    Also:
    - core/ports.py: +ToolCallLLMPort protocol (zero-dep)
    - integrations/llm: +AnthropicToolCallLLM, +OpenAIToolCallLLM
    - factory.py: +build_tool_call_llm_from_env()
    - CLI: +lang2sql agent, +lang2sql tui commands
    - pyproject.toml: optional dependency groups (tui, viz, agent)
    - 231 tests passing, 6 skipped, backwards compatible
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
    seyoung4503 and claude committed Apr 17, 2026
    Configuration menu
    Copy the full SHA
    55e2584 View commit details
    Browse the repository at this point in the history
Loading