Pewarta Proxy

๐Ÿ“‹ Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

โš™๏ธ Pengaturan Proxy Target

Skip to content
CausalInferenceLabPublic

About

No description, website, or topics provided.

Resources

Stars

140 stars

Watchers

4 watching

Forks

Latest commit

ย 

History

512 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Lang2SQL

PseudoLab Discord Community Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors

์šฐ๋ฆฌ๋Š” ํ•จ๊ป˜ ์ฝ”๋“œ์™€ ์•„์ด๋””์–ด๋ฅผ ๋‚˜๋ˆ„๋ฉฐ ๋” ๋‚˜์€ ๋ฐ์ดํ„ฐ ํ™˜๊ฒฝ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ ์˜คํ”ˆ์†Œ์Šค ์—ฌ์ •์„ ๋– ๋‚ฉ๋‹ˆ๋‹ค. ๐ŸŒ๐Ÿ’ก


A document-learning, read-only SQL analytics agent. Feed it your company's docs โ†’ it learns your business context โ†’ it keeps a separate set of definitions per team โ†’ it answers questions over an incomplete database โ†’ it remembers every definition and conversation.

๐Ÿ‘‰ ํ”„๋กœ์ ํŠธ ์ „์ฒด ๊ทธ๋ฆผ(๋‹จ์ผ SSOT): docs/PROJECT.md ยท ์ปจํŠธ๋ฆฌ๋ทฐํ„ฐ ํ•œ๋ˆˆ ๊ฐ€์ด๋“œ: docs/ARCHITECTURE.md

This is the v4.1 rebuild (๋ฐฐ๊ฒฝ/์„ค๊ณ„ ์˜๋„: docs/discord_first_redesign_v4_1.md). Where most text-to-SQL projects compete on "generate better SQL," Lang2SQL competes on everything around the query: business-context learning, per-team semantics, robustness to messy databases, and memory. Discord is the Phase 1 interface, not the identity โ€” Slack/Web are adapters on the same core.


Core capabilities

Pillar What it is
โ‘  Business-context learning Documents are the source of truth. Drop in a doc โ†’ the agent extracts metric/dimension/rule candidates โ†’ you confirm โ†’ they land in the semantic layer.
โ‘ก Two-axis robustness (2a) DB robustness โ€” works even when columns lack descriptions (auto-enrichment, v1.5). (2b) Semantic robustness โ€” teams hold different definitions of the same term without conflict. This axis is the product/research identity.
โ‘ข Hermes memory Conversations, facts, and preferences persist instead of resetting each session.
โ‘ฃ Multi-interface Phase 1 Discord today; Slack/Web are future adapters. No platform lock-in.

Extensibility โ€” plug-in extension points

V1 ships the simplest single implementation of each extension point, but the abstraction (port) is already in place, so v1.5/v2 plug in a new implementation without touching existing code โ€” like a standard wall outlet where you swap the appliance, not the wiring.

Four โ˜… extension patterns sit behind core/ports/:

โ˜… Pattern Port Grows by
โ‘  Safety pipeline ports/safety.py adding one layer class to the line (zero run_sql changes)
โ‘ก Memory service ports/memory.py swapping any of 3 axes โ€” Store / Recall / Extractor โ€” independently
โ‘ข Ingestion pipeline ports/ingestion.py a Source ร— Extractor matrix
โ‘ฃ Semantic federation ports/semantic_scope.py git-like per-team scope branches

Everything outside tenancy/concierge.py depends only on these Protocols, so the concrete classes (OpenAI, Postgres, SQLite) are swappable at the seams.


Quickstart

Requires Python โ‰ฅ 3.10 and uv.

uv sync                       # create .venv and install deps

1. Run the offline demo (no token, no database)

.venv/bin/python bench/ecommerce_demo.py

Shows the federation money-shot (one term, two team definitions, no conflict) and the safety gate (DROP/INSERT blocked, SELECT passes). See bench/README.md.

2. Run the CLI (developer driver)

.venv/bin/lang2sql "list the tables"

The CLI assembles a real HarnessContext and runs one turn through the agent loop. With OPENAI_API_KEY set it calls gpt-4.1-mini; otherwise it uses the offline FakeLLM.

3. Run the Discord bot

export DISCORD_BOT_TOKEN=...        # required
export OPENAI_API_KEY=...           # optional; offline FakeLLM if unset
export LANG2SQL_SECRET_KEY=...      # optional; Fernet key for secret encryption
.venv/bin/lang2sql-bot

The bot exits loudly if DISCORD_BOT_TOKEN is unset. Full setup and hosting: docs/DEPLOY.md. Copy .env.example to start.


What V1 does / does NOT do yet (honesty section)

Does:

  • 3-scope semantic federation (org / team / user) โ€” ๋™์ผ ์šฉ์–ด์— ์—ฌ๋Ÿฌ ๋ ˆ์ด์–ด ์ •์˜๊ฐ€ ์กด์žฌํ•˜๋ฉด ํ˜„์žฌ ์ฑ„๋„ ์ •์˜๋ฅผ โ˜… ๋กœ ํ‘œ์‹œํ•˜๊ณ  ์ „์ฒด ์ฃผ์ž…; LLM์ด ์ปจํ…์ŠคํŠธ๋กœ ํŒ๋‹จ. term_custom registers definitions per scope (KV-backed); kind(metric/table/rule/dimension) ยท applies_to ยท tags ํ•„๋“œ ์ง€์›.
  • Safety pipeline with the V1 layers (whitelist + timeout), gating every query.
  • Agent loop with nine tools: run_sql, explore_schema, enrich_schema, term_custom, org_setup, ingest_doc, confirm_ingest, remember, ask_user.
  • Memory service (in-memory store + inject-all recall + manual /remember).
  • Discord frontend (bot, commands, session router, render).
  • Encrypted-at-rest secrets (Fernet) and SQLite-backed persistence.

Does NOT yet:

  • Execute against a real database. PostgresExplorer is a V1 stub with canned orders/users schema and sample rows; real psycopg execution is v1.5.
  • Reason without a key. Without OPENAI_API_KEY, the FakeLLM returns deterministic canned tool cycles โ€” useful for wiring tests, not for answers.
  • AST-precise SQL validation, function blocklists, cost gating, /semantic diff / /semantic promote, keyword/vector recall, automatic fact extraction, URL/Notion ingestion โ€” all scoped to v1.5+.
  • Persist across restarts by default: the V1 SqliteStore defaults to in-memory; point it at a file for durability.

Roadmap at a glance

Current status: V1 complete โ€” enrich_schema and OKF bundle export are V1.5 features already shipped; next target is AST validation, SQLite file-mode default, and keyword recall.

Area V1 V1.5 V2 V2.5
Safety whitelist + timeout + AST validation, function blocklist, auto LIMIT, metadata enrichment, rate limit + cost gate (EXPLAIN), per-engine pipelines โ€”
Memory in-memory + inject-all + manual SQLite store + keyword recall + auto-extract + vector recall + conflict resolution PostgreSQL + hybrid recall + confidence
Ingestion file upload + LLM extract + URL fetch + DDL parsing + Notion/Confluence + hybrid + GitHub/Drive + chunked RAG
Federation 3-scope resolution, /semantic show /semantic diff, /semantic promote, conflict alerts git sync (semantic-as-code) branch fork/merge UI, per-scope audit
Interface Discord (Anthropic/NIM eval) Slack Web

See docs/discord_first_redesign_v4_1.md for the full architecture write-up.


๐Ÿค ๊ธฐ์—ฌํ•˜๊ธฐ

์ฒ˜์Œ ๋ณด์‹œ๋Š” ๋ถ„์€ docs/ARCHITECTURE.md โ€” ๋””๋ ‰ํ† ๋ฆฌยท๋ ˆ์ด์–ด ์ฑ…์ž„, ํ•œ ๋ฉ”์‹œ์ง€์˜ lifecycle, ์–ด๋””๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ์ข‹์„์ง€ ๊ฐ€ ํ•œ๊ณณ์— ์ •๋ฆฌ๋ผ ์žˆ์Šต๋‹ˆ๋‹ค.

git clone https://github.com/CausalInferenceLab/lang2sql.git
cd lang2sql
uv sync
.venv/bin/pytest -q          # 12 safety regressions + full suite must pass
  • ์ƒˆ ๊ธฐ๋Šฅ์—๋Š” ํ…Œ์ŠคํŠธ ์ž‘์„ฑ (tests/test_<layer>.py)
  • PR์€ master ๋ธŒ๋žœ์น˜ ๋Œ€์ƒ, ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€์— feat: / fix: / docs: prefix ์‚ฌ์šฉ
  • ๋ฒ„๊ทธ/๊ธฐ๋Šฅ ์š”์ฒญ์€ ์ด์Šˆ๋กœ

๐Ÿ™ ๊ฐ์‚ฌ์˜ ๋ง / License

Lang2SQL์€ ๊ฐ€์งœ์—ฐ๊ตฌ์†Œ์˜ ์ธ๊ณผ์ถ”๋ก ํŒ€์—์„œ ๊ฐœ๋ฐœ ์ค‘์ธ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค. Licensed under the MIT License. ์ปค๋ฎค๋‹ˆํ‹ฐ: Discord.


๐Ÿ† Our Team

Role Name Skills Interests
Project Manager ์ด๋™์šฑ Python LLM, Open Source, Causal Inference
AI Engineer ๋ฌธ์ฐฌ๊ตญ Python LLM, Agentic RAG, Open Source
Data Engineer ๋ฐ•๊ฒฝํƒœ Python LLM-driven Data Engineering
AI Engineer ์†๋ด‰๊ท  Python LLM, RAG, AI Planning
Data Scientist ์•ˆ์žฌ์ผ Python LLM, Data Analysis, RAG
ML Engineer ์ดํ˜ธ๋ฏผ Python Multi-Agent Systems
AI Engineer ์ตœ์„ธ์˜ Python LLM, RAG, Multi-Agent
Full-Stack Developer ํ™ฉ์œค์ง„ NextJs React LLM Orchestration
AI Engineer ๊น€๊ฒฝ์„œ Python LLM, FinNLP, FDS, RAG
Data Engineer ํ™์ง€์˜ Python LLM, Data Engineering
Data Operator ์ดํ™”๋ฆผ Python LLM, Data Engineering
AI Engineer ์กฐํƒœ๋ฏผ Python LLM, RAG, Multi-Agent
AI Engineer ์‹ฌ์„ธ์› Python LLM, RAG, Multi-Agent
Business Analyst ์„œํฌ์ง„ Python LLM, Data Analysis

๐ŸŒ ๊ฐ€์งœ์—ฐ๊ตฌ์†Œ ์†Œ๊ฐœ

๊ฐ€์งœ์—ฐ๊ตฌ์†Œ๋Š” ๋จธ์‹ ๋Ÿฌ๋‹๊ณผ AI ๊ธฐ์ˆ  ๋ฐœ์ „์— ์ค‘์ ์„ ๋‘” ๋น„์˜๋ฆฌ ์กฐ์ง์ž…๋‹ˆ๋‹ค. ๊ณต์œ , ๋™๊ธฐ๋ถ€์—ฌ, ๊ทธ๋ฆฌ๊ณ  ํ˜‘์—…์˜ ๊ธฐ์จ์ด๋ผ๋Š” ํ•ต์‹ฌ ๊ฐ€์น˜๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์˜ํ–ฅ๋ ฅ ์žˆ๋Š” ์˜คํ”ˆ์†Œ์Šค ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.

์ „ ์„ธ๊ณ„ 5,000๋ช… ์ด์ƒ์˜ ์—ฐ๊ตฌ์ž๋“ค๊ณผ ํ•จ๊ป˜, ์šฐ๋ฆฌ๋Š” AI ์ง€์‹์˜ ๋ฏผ์ฃผํ™”์™€ ์—ด๋ฆฐ ํ˜‘์—…์„ ํ†ตํ•œ ํ˜์‹  ์ด‰์ง„์— ์ „๋…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ปค๋ฎค๋‹ˆํ‹ฐ: ๐Ÿ’ฌ Discord


๐ŸŽฏ ๊ธฐ์—ฌ์ž๋“ค

About

No description, website, or topics provided.

Resources

Stars

140 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages