Terno AI is a team of AI data scientists dedicated to helping organizations unlock insights from their structured data. Using SQL queries, machine learning model development, and domain-specific algorithms, Terno AI analyzes your databases to deliver actionable results.
These insights can be presented in various formats, including plain text, graphs, charts, and tables. You can easily share the results with your team or schedule them to be delivered via email.
Additionally, intermediate datasets and models can be cached for reuse, streamlining your workflow.
- Stores domain knowledge—automatically inferred or provided by experts—to enhance SQL generation accuracy.
- Supports seamless, automatic updates to the Metastore.
- Captures inferred knowledge from data to improve query precision.
- Query Sanitization: Prevents harmful SQL execution and enforces Role-Based Access Control (RBAC) without direct database interaction.
- Optimized Query Generation: Minimizes prompt size while boosting the efficiency of LLM-generated SQL.
- Enterprise Security: Guards against SQL injection and unauthorized access.
Databases are critical for organizations but are limited to syntactic searches rather than semantic understanding. For example, searching for "blue jeans" in an e-commerce database might miss products labeled "navy denims" due to keyword-based limitations.
Terno AI addresses this with a semantic layer, enabling text searches based on meaning and similarity, not just exact matches.
Terno AI generates intermediate artifacts—such as datasets, machine learning models, code, graphs, and charts—to answer complex queries. These artifacts are saved in the Artifact Store, making them reusable across teams. This accelerates result generation and enhances data understanding within organizations.
Every organization has unique workflows, such as sending emails, calling internal APIs, or scheduling jobs. Terno AI offers an extensible tooling augmentation layer to integrate with these processes. For example, you can instruct Terno to "send a report via email to my team every Monday morning."
- Works with major databases like PostgreSQL, MySQL, BigQuery, and more
- Also integrate with most of the ERPs such as Odoo.
- Use LLM of your choice without leaking data in your database to them
- It also support multi-LLMs setup where you may have one LLM for long form generation, second LLM backend tasks and other LLM for text embeddings generation.
- Built for developers, data teams, and enterprises
git clone https://github.com/terno-ai/terno-ai.git
cd terno-ai
docker compose up --build
- Clone Repository
git clone git@github.com:terno-ai/terno-ai.git --depth 1
- Change directory
cd terno-ai
- Build frontend
. ./build_frontend.sh
- Create virtualenv
virtualenv -p python3.10 venv
- Activate venv
. venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Source env file
source env-sample.sh
- Migrate Database
python terno/manage.py migrate
- Run server
python terno/manage.py runserver
Django server is running on http://127.0.0.1:8000 by default and admin url is http://127.0.0.1:8000/admin/. To configure go to the admin page.
- Default admin user email is
admin@example.com
- password is
Superadmin@123
- Add LLM Configuration -
/admin/terno/llmconfiguration/
- Connect your Datasource -
/admin/terno/datasource/
. It will import your tables and columns. - Go to http://127.0.0.1:8000 to start using Terno.ai
- To restrict a table's access globally use
/admin/terno/privatetableselector/
. To allow access to the globally restricted table to a specific group use/admin/terno/grouptableselector/
- To restrict a column's access globally use
/admin/terno/privatecolumnselector/
. To allow access to the globally restricted column to a specific group use/admin/terno/groupcolumnselector/
- To restrict a row's access globally use
/admin/terno/tablerowfilter/
. To allow access to the globally restricted row to a specific group use/admin/terno/grouptablerowfilter/
- Run
npm run dev
inside frontend directory to run vite dev server - Make changes to src files in react frontend
- Run the
build_frontend.sh
script to build and deploy to django directly - Commit both react changes and build files
python manage.py test terno
coverage run manage.py test
coverage report -m
coverage html
Open the htmlcov/index.html
file in browser
- To restrict a table's access globally use
/admin/terno/tablerowfilter/
.
Ex. To restrict row access for sales
table with filter company_id = 10 and category_id not in (1, 2, 3)
add create tablerowfilter
- To allow access to the globally restricted table to a specific group use
/admin/terno/grouptablerowfilter/
Ex. To allow access to group Groceries
access to the restricted category_ids and category_ids 12 and 13 which was added using previous method, create grouptablerowfilter with group Groceries
and filter like
where (
(company_id = 10 and category_id not in (1, 2, 3))
AND (
(category_id = 12)
OR
(category_id = 13)
)
)
- Run rabbitmq for message broker
celery -A mysite worker --loglevel=info
We welcome contributions! Feel free to open an issue or submit a pull request