Are you in need of an AI-assistant in Systems Engineering? — Welcome to LLMs that write Queries

Sruthi Radhakrishnan
3 min readJul 31, 2023

--

Systems engineering is the ultimate balancing act of machines, software, and processes. Initially, engineers relied heavily on their own smarts and experience (manual processes). But with time, things evolved. They started to mix in bits from management, operations research, and human factors. The result? An exciting toolbox filled with system modelling and simulation, requirements management, and risk analysis.

Target audience: Systems engineers, Graph Data Enthusiasts, ML Engineers, Business Development Managers etc

Can we boost one of the processes by leveraging the power of LLMs? — Writing Queries

If we visualise any system model, their structures are best denoted by using Graps. Let’s call it Traceability Knowledge graphs. With all the valuable information, a systems engineer would like to ask questions and get the following information.

  • How much will it cost to change this process?
  • 20 Euros/day
  • Which requirement does this specific system component address?
  • This system component addresses requirement #5.
  • What system components are associated with this particular requirement?
  • System components #3 and #7 are associated with this requirement.
  • Can you trace the origin of this system fault?
  • This system fault originates from component #5
  • Which tests are related to requirement #5?
  • Tests #1, #3, and #5 are related to requirement #5

However, querying this knowledge graph requires writing queries based on the database used. For instance, SQL, GSQL and Cyphers. The complexity depends on factors such as

  • Syntax and Structure
  • Data Relationships
  • Efficiency and Performance
  • Nested Queries
  • Debugging

Here is a simple example using LangChain and ChatGPT API to write Cypher Queries:

First things first:

What is Cypher?

Cypher is a Graph Query Language, used for querying Graph databases especially Neo4j. OpenCypher is an open-source project that started with the goal of making the Cypher query language available to the open-source community that formed the basis. Currently, there is a number of graph query languages available across various graph databases and there is a forum working on unifying these languages called GQL Standards.

What is a graph database?

A graph database is a type of database that uses graph structures to store and organize data. Unlike traditional relational databases, which use tables to store data, a graph database uses nodes, edges, and properties to represent and store data. The node-edge structure allows for more flexible and efficient querying of interconnected data. They are also well-suited for handling large amounts of interconnected data, as they can easily traverse and query the graph structure.

Refer the following blog post for more information: Click here

What is a Large Language Model?

A large language model is a type of artificial intelligence system that is designed to understand and generate human language. These models are trained on vast amounts of text data, such as books, articles, and websites, to learn the patterns and structures of language. The goal of a large language model is to be able to generate coherent and contextually appropriate responses to text prompts.

For more information: Click here

Do we have an interface to make this possible?

Indeed! We have “LangChain” is a framework for developing applications powered by language models. It helps these apps connect to data and other environments. It comes with ready-to-use building blocks, called components, and pre-made sets of these blocks, called chains, that are designed for common tasks. These make it easy for anyone to start building. But if you have special needs or a more complex project, you can also customize these building blocks or create new ones.

Here is the live demo of the framework to generate Queries using Natural language on the Famous Movies database in Neo4J and Streamlit :)

Link:

Resources:

--

--