Prerequisites
- You’ll need to have Python installed on your system.
- You’ll need to have
pipinstalled on your system. - You’ll need an Anthropic API key, or API key from another LLM provider
Example notebookThis example can be found as a notebook in the examples repository.
1
Install libraries
Run the following commands using
pip to install the required libraries:2
Setup credentials
Next, you’ll need to provide your Anthropic API key:Next, define the credentials needed to connect to the ClickHouse SQL playground:
Using another LLM providerIf you don’t have an Anthropic API key, and want to use another LLM provider,
you can find the instructions for setting up your credentials in the DSPy docs
3
Initialize MCP server
Now configure the ClickHouse MCP server to point at the ClickHouse SQL playground.
4
Initialize LLM
Next, initialize the LLM with the following line:
5
Run the agent
Finally, initialize and run the agent:
Response