Users expect products to have AI features that automate workflows or allow them to explore their data using natural language. Ekaya is a production-ready, secure, and self-contained text-to-SQL solution designed to protect data access in multi-tenant products.
The Ekaya Embedded Server runs entirely within your product environments so that data never leaves your data boundary.
Product Demo Video Coming Soon
See Ekaya embedded in a real SaaS application
Example PostgreSQL Setup
The recommended best practice is to create non-materialized views of the product data you want AI to access. Configure multi-level isolation: tenant-level (organization), role-based (admin vs user), and user-specific (only assigned records). Choose one of two approaches based upon availability of database-level protection:
Enable RLS on your base tables with policies enforcing tenant, role, and user-level permissions. Note: policies are automatically enforced when querying through SQL views.
ALTER TABLE subscriptions
ENABLE ROW LEVEL SECURITY;
CREATE POLICY user_data_access
ON subscriptions USING (
tenant_id = current_setting(
'app.tenant_id')::uuid
AND (
user_id = current_setting(
'app.user_id')::uuid
OR current_setting('app.role') = 'admin'
)
);Include tenant_id and user_id columns in views. Ekaya validates all generated SQL includes multi-level WHERE clauses.
CREATE VIEW customer_subs AS
SELECT id, tenant_id, user_id, status
FROM subscriptions;
-- For regular users, Ekaya generates:
SELECT * FROM customer_subs
WHERE tenant_id = $1
AND user_id = $2
-- For admins, Ekaya generates:
SELECT * FROM customer_subs
WHERE tenant_id = $1Attach Ekaya Engine to a development or stage database and import only those Views (see Developers). This sets up the schema, ontology, and any pre-created queries that your product will need.
Note: You do not need to access the Production database in this step. This is only extracting schema, ontology, and query templates from your development/stage environment.
This configuration will be deployed into your product environments (dev, stage, production) and contains everything the Ekaya Embedded Server needs to generate safe SQL from natural language prompts.
The Ekaya Embedded Server loads the static configuration into memory at launch (and reloads upon SIGHUP). Can be isolated in its own VPC and only requires access to embedded models.
Ekaya provides specialized, fine-tuned models that you can deploy within your data boundary, or you can bring your own key to use your preferred LLM provider.
Your product server communicates with the Ekaya Embedded Server to generate secure, tenant-scoped SQL from natural language queries.
The Ekaya Embedded Server is designed to run in Product Environments with five-nines availability
Per-request authentication with automatic row-level security enforcement
Every query is automatically scoped to the authenticated user's tenant and permissions. No shared service accounts, no privilege escalation risks.
Built-in guarantee: Users can only access rows they own. The system validates every generated query contains proper tenant isolation before returning SQL to your product.
Multi-layer validation ensures generated SQL is safe and doesn't leak sensitive data.
Real-time validation: Every SQL query receives an injection score and leakage risk assessment. Your product gets full visibility into security metadata before executing.