Introducing PromptQL Program API: Dynamic Integrations made simple
PromptQL is a data access agent that creates and runs query plans. With access to Hasura DDN connectors, PromptQL integrates with any data source, allowing AI models to access and interact with all your data under a unified schema.
With the PromptQL Program API, you can now trigger PromptQL Programs via HTTP, bringing flexibility and intelligence to your business workflows. Whether you're automating workflows or enhancing analytical reports, the API ensures seamless integration outside the chat interface of the PromptQL Playground.
What are PromptQL Programs?
PromptQL Programs are Python programs that read and write data via Python functions. PromptQL Programs are generated by LLMs. These programs are typically executed within the PromptQL Playground during interactive sessions. However, with the Program API, saved PromptQL Programs can now be executed on demand, allowing developers to integrate them into external systems and automate complex tasks effortlessly.
PromptQL Programs can:
Read/write or search through data by invoking Python functions. The tools are implemented outside of PromptQL. Example tools:
Search: Vector, attribute, keyword, etc.
Reading and writing data: Interact with databases effectively.
Interacting with APIs: Seamlessly integrate external APIs.
Use PromptQL Primitives (classify, summarize, extract) to make use of LLM’s capabilities.
Create memory artifacts (text or table) to reference the data anytime in a thread.
The ability of the PromptQL agent to consistently generate high-quality PromptQL Programs is one of the important factors that determine the effectiveness of PromptQL.
Generating the API
Here is the specification for the Program API:
API endpoint:
POST https://api.promptql.pro.hasura.io/execute_program
You can generate the API code from a Playground interaction by clicking on the API button as shown below:
Authentication: Secure your Program API
By default, the Program API uses an ephemeral Hasura DDN token for authentication. While this is sufficient for testing and internal applications, production environments require robust authentication mechanisms.