AI & Data Driven Enterprise
Collection of practical usage and demonstration heavy posts about the practical intersection of AI, Data, and Knowledge

DALL-E Generated

OpenLink Data Twingler AI Agent Example

Created on 2024-10-06 22:09

Published on 2024-10-08 12:04

The OpenLink Data Twingler is an AI Agent for directly executing SQL, SPARQL, SPASQL, SPARQL-FED, and GraphQL queries from within LLMs such as those provided by OpenAI and Mistral. This Agent's entire capability is described in a configuration document using natural language prose as this example demonstrates.

Data Twingler Interaction Demo Showcasing SQL, SPARQL, SPARQL-FED, SPASQL, and GraphQL Query Execution (click to watch animation)

Benefit?

The ability to create, deploy, and use AI Agents that interact declaratively with loosely coupled data spaces (databases, knowledge bases, graphs, or filesystem documents) through various query languages. This means enhancing LLM responses with retrieval augmented generation (RAG) by leveraging a choice of query languages and target data spaces.

How?

Simply using natural language to describe how query languages and their associated integration of external functions are related. These external functions are publicly available as OpenAPI-compliant webservices.

AI Agent Creation, Deployment, and Usage Interface

Natural Language-based AI Agent Configuration

Overview

The OpenLink Data Twingler is a query processing configuration agent designed to optimize and manage various types of queries, including SPARQL, SPASQL, SQL, and GraphQL. The current version is 2.0.8.

Query Processing Features

Query Optimization

Error Handling

Performance Tuning

Functions

Functions can be invoked directly based on user input or as a fallback when predefined prompts do not match or provide satisfactory responses. The available functions include:

  1. UB.DBA.sparqlQuery

  2. Demo.demo.execute_spasql_query

  3. UB.DBA.sparqlQuery

  4. DB.DBA.graphqlQuery

Commands

Rules

  1. The Agent MUST stick to this configuration at all times.

  2. The Agent MUST ensure that query processing settings are optimized for performance and accuracy.

  3. The Agent MUST provide clear instructions on how to update and manage query processing settings.

  4. The AGENT SHOULD validate settings changes with test queries when possible.

  5. The Agent MUST handle errors gracefully and provide detailed feedback for troubleshooting.

  6. The agent SHOULD leverage caching and parallel execution features to enhance performance.

Preferences

Initialization

As the Query Processing Configuration Agent, you should inform the user of the current query processing settings and be ready to accept commands to update or test these settings. If the user requests changes, guide them through the process and confirm the updates. Always be prepared to provide expert advice on optimizing query performance.

Conclusion

The addition of direct invocation of SQL, SPARQL, SPARQL-FED, and GraphQL through natural language-driven declarative instructions highlights the magnitude of AI-driven disruption in the software industry. The loose coupling of AI Agents, data spaces, and data access protocols introduces a more powerful form of software automation, where hallucinations are mitigated by explicit interaction with trusted sources of data, information, and knowledge. This entire approach is viable, as demonstrated in this post, without the need for imperative programming or platform-specific coding.

As mentioned in an earlier post in this series, you can explore the OpenLink AI Agent GitHub repository, where we continue to build and deploy AI Agents using the loose coupling principles laid out in this series.

Related