briefercloud / briefercloud/briefer

AI agent not working for SQL blocks and connection metadata embeddings

Open
#362 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.3k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

I'm experiencing issues while configuring the AI features in Briefer using Azure OpenAI. After setting all the environment variables, only the AI functionality for Python code blocks is working as expected. When I try to use it with SQL code blocks, the UI gets stuck loading indefinitely, and I see error logs in the API deployment. Additionally, Briefer is failing to generate schema embeddings for the tables connected via Trino. I'm using the latest briefer version, deployed in Kubernetes using the Helm chart provided, with minimal changes to accommodate to my necessities.

Here's the error log from the API deployment related to Trino schema embedding:
```json
{
"level": 50,
"time": 1751055757212,
"pid": 17,
"hostname": "api-deployment-4cf5df6bnd-ljrll",
"err": {
"type": "NotFoundError",
"message": "404 Resource not found",
"stack": "Error: 404 Resource not found\n at APIError.generate (file:///app/node_modules/openai/error.mjs:50:20)\n at OpenAI.makeStatusError (file:///app/node_modules/openai/core.mjs:286:25)\n at OpenAI.makeRequest (file:///app/node_modules/openai/core.mjs:330:30)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"status": 404,
"headers": {
"apim-request-id": "20f3a12b-6179-4223-8719-c83b5d00c3a3",
"content-length": "56",
"content-type": "application/json",
"date": "Fri, 27 Jun 2025 20:22:36 GMT",
"strict-transport-security": "max-age=31536000; includeSubDomains; preload",
"x-content-type-options": "nosniff"
},
"error": {
"type": "Object",
"message": "Resource not found",
"stack": "",
"code": "404"
},
"code": "404"
},
"dataSourceId": "v4144ca4-4411-4cdc-7966-0fas227b60d79",
"dataSourceType": "trino",
"schemaName": "",
"tableName": "",
"msg": "Failed to create embedding"
}
```

Here's the error log from the API deployment related to the SQL block editor:

```json
{
"level": 50,
"time": 1750969237170,
"pid": 18,
"hostname": "api-deployment-5cf5gb6bdd-wgv42",
"workspaceId": "86e210a3-661b-486b-ad6c-962ed15e6ab5",
"documentId": "b1ba9076-03b7-5254-8ee6-4543b92f5541",
"blockId": "13648ea5-76c8-37e1-8fb3-44b48f22233b",
"err": {
"type": "NotFoundError",
"message": "404 Resource not found",
"stack": "Error: 404 Resource not found\n at APIError.generate (file:///app/node_modules/openai/error.mjs:50:20)\n at OpenAI.makeStatusError (file:///app/node_modules/openai/core.mjs:286:25)\n at OpenAI.makeRequest (file:///app/node_modules/openai/core.mjs:330:30)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"status": 404,
"headers": {
"apim-request-id": "9237325c-c34f-45a3-fa88-f1b1ea701a76",
"content-length": "56",
"content-type": "application/json",
"date": "Thu, 26 Jun 2025 20:20:36 GMT",
"strict-transport-security": "max-age=31536000; includeSubDomains; preload",
"x-content-type-options": "nosniff"
},
"error": {
"type": "Object",
"message": "Resource not found",
"stack": "",
"code": "404"
},
"code": "404"
},
"msg": "Error editing SQL block with AI"
}
```

For python code blocks, it works perfect.

![Image](https://github.com/user-attachments/assets/f03058e8-0985-4f8e-8955-efae06ac6553)

I'm not sure if I'm missing a configuration step, if these features aren't fully supported in the open-source version, or if there's a bug. Could someone help clarify this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the API deployment logs for the SQL block editor and Trino schema embedding failures, then review the Azure OpenAI environment variables and Helm deployment configuration. Reproduce both failures and trace the two API paths separately; done means SQL AI no longer loads indefinitely and schema embeddings are created for Trino tables.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, helm, kubernetes
Domain
ai, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.