This is a slack-bot version of tbls-ask.
You can call tbls-ask from slack by mentioning the bot.
To use the tbls-ask-agent-slack bot, mention it in a Slack channel where it's been added. The bot can answer questions about your database schema using natural language.
You can ask questions like:
"@tbls-ask name of the users who has the most stars"
The bot will respond with an SQL query that answers your question. For the example above, it would provide a query to find the user with the most stars on their comments.
- The bot receives your question through a Slack mention.
- It interprets your natural language query.
- It generates an appropriate SQL query to answer your question.
- The bot returns the SQL query in the Slack thread.
- The bot provides SQL queries but does not execute them directly on your database.
- You need to run the provided SQL query on your own MySQL database to get the actual results.
- The database document must be prepared using
tbls
.
- OPENAI_API_KEY: API key for OpenAI
- SLACK_APP_TOKEN: App token for Slack
- SLACK_OAUTH_TOKEN: OAuth token for Slack
- GITHUB_TOKEN: Token for GitHub API (optional)
- CUSTOM_INSTRUCTION: Custom instruciton for LLM (optional)
- MODEL_NAME: Model name for OpenAI (optional, default: gpt-4o)
Please create an app using manifests.yml
and install it to your workspace.
Copy schemas/config.yml.sample
to schemas/config.yml
and edit it.
$ cp schemas/config.yml.sample schemas/config.yml
make embeddings
make server
It is using socket mode for slack. You don't need to expose the server to the internet.
Build docker image locally
make build-image
Apply manifests
make all