Snowy mountain landscape background
npm version
npm downloads
PyPI version
License: AGPL 3.0

Introducing SED

Semantic Entities Designs

Transform your database into an AI-ready semantic layer that empowers AI to understand your business. SED provides the infrastructure AI needs while keeping you in control of your data and rules.

sed-builder.ts
sed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# WITHOUT SED - Manual, Unsafe, Complex, No Control
import psycopg2
from openai import OpenAI
# --- Setup OpenAI ---
client = OpenAI(api_key="YOUR_API_KEY")
# --- Step 1: Connect to PostgreSQL ---
conn = psycopg2.connect({
host="localhost",
database="your_db",
user="your_user",
password="your_password"
})
cursor = conn.cursor()
# --- Step 2: Read DB schema + data ---
table_name = "sales"
# Get table schema
cursor.execute(f"""
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = %s
""", (table_name,))
schema = cursor.fetchall()
# Get table data
cursor.execute(f"SELECT * FROM {table_name}")
rows = cursor.fetchall()
# --- Step 3: Send to GPT-5 ---
prompt = f"""
You are a data analyst.
Here is the database schema: {schema}
Here is the data: {rows}
Please forecast revenue for next 3 months.
"""
response = client.responses.create({
model="gpt-5",
input=prompt
})
print("AI Analysis:")
print(response.output[0].content[0].text)
# --- Cleanup ---
cursor.close()
conn.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# WITH SED - Secure, Controlled, Intelligent
from sedql import SEDClient
from openai import OpenAI
# --- Setup SED (OpenAI optional) ---
# SED handles DB connections, security, and business context
sed = SEDClient()
client = OpenAI(api_key="YOUR_API_KEY") # Optional
# --- Secure AI query with business context ---
response = sed.query_with_ai({
"natural_language": "Forecast revenue for next 3 months",
"ai_model": "gpt-5",
# "ai_client": client, # Optional - users bring their own AI
"business_context": "Revenue forecasting for Q3 planning"
})
print("AI Analysis (SED-Protected):")
print(response['insights'])
print(f"Risk Level: {response['risk_assessment']['risk_level']}")
print(f"Business Context: {response['business_context']}")
print(f"Query Results: {response['query_result']}")
# Rich response with all features:
# response = {query_result, insights, risk_assessment, business_context}
# SED automatically provides:
# • Enterprise security & access control
# • Business context & domain intelligence
# • PII protection & audit logging
# • Schema change detection
# • Local-first data privacy

What is SED?

SED automatically detects your business domain, maps technical terms to business language, and provides AI with the context it needs to understand your data. Every query gets business intelligence and secure workflows.

Your AI Empowerment Platform

Three powerful pillars that give AI the understanding and infrastructure it needs while keeping you in control

AI Infrastructure & Control

Give AI the infrastructure it needs with rate limiting, PII detection, and access control. Every query goes through secure workflows that keep you in control while empowering AI.

Business Intelligence for AI

Help AI understand your business by automatically detecting your domain and mapping technical names to business terms. Transform "user_id" into "Customer ID" so AI can work intelligently.

Community-First Architecture

Your data never leaves your infrastructure. SED runs entirely on your machines with no cloud dependencies, ensuring community ownership and data sovereignty.

Developer workspace with laptops and coding

Built for community ownership.

Works with your business intelligence.

Community-First - your data, your rules, your AI infrastructure.

How to use SED?

Get AI agents querying your database safely in minutes.

npx sedql init

Interactive setup

Automatically detects your domain and generates business context with connection pooling and security validation.

Deploy secure API endpoints

Get /api/plan, /api/approve, /api/execute with enterprise-grade security, rate limiting, encryption, and risk assessment built-in.

Monitor and validate

Schema change detection, health monitoring, structured error handling, comprehensive audit logging, and PII protection.

AI Agent integration

Secure plan → approve → execute workflow with business context resolution, automatic guardrails, and complete control.

Enterprise-grade
security & control,
automatic business
intelligence, and
complete data
privacy out of
the box.

View Documentation
Snowy mountain landscape background

Why SED?

The best way to give AI the infrastructure and understanding it needs while keeping your community in control.

Security & Control: Complete control over AI access with rate limiting, account lockout, encrypted plan storage with expiration, PII detection, access control, and comprehensive audit logging.

Business Intelligence: Automatic domain detection with technical-to-business mapping, terminology resolution, and domain-specific business rules that understand your industry.

Local-First Architecture: Your data never leaves your infrastructure. SED runs entirely on your machines with no cloud dependencies, ensuring complete data privacy and control.

AI Agent Workflow: Secure plan → approve → execute pipeline with risk assessment, PII protection, automatic guardrails, and complete human oversight for safe AI-database interactions.

Enterprise Monitoring: Connection pooling, health diagnostics, schema change detection with impact analysis, structured error handling across 9 error types, and production-grade reliability.

Stay Updated

Get notified when SED launches and receive updates on new features, integrations, and best practices.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.