Building Streaming Data Connectors Faster with OpenAI’s GPT-4

By  William Hill

 2 Jun 2023

The responsibility of connecting different data stores has historically fallen to an entire team of developers who write custom code and manage complex data integrations. Conduit, an open-source project powered by Meroxa, has made this undertaking a lot simpler. We designed the Conduit SDK with data movement best practices in mind, requiring fewer developers to build out pipelines with the same level of efficacy but with greater efficiency. If you’re unfamiliar, Conduit is a data integration tool for developers built with the purpose of moving data from point A to point B and it does this via the use of connectors. By adding Open AI’s GPT-4 into the mix to speed up the build of connectors, connecting data sources has become a breeze for us. In this blog post, we’ll go over why speeding up connector building was necessary and how we were able to accomplish it via GPT-4.

Why Did We Need to Reduce Connector Build Time?

On the government side of our business, we operate as a small, lean team with multiple efforts happening in tandem. One of those efforts is a project with the United States Space Force to build data pipelines from commercial and government providers to a central repository or library where the aggregated data can be easily accessed and utilized. Getting those pipelines built quickly is of the utmost importance to the customer due to demand, so reducing the time to build connectors without burdening our team was essential. Not only is reducing build time beneficial for the government team, but it’s also beneficial to our company and our users as a whole. This worthwhile investment will pay dividends down the road.

How Did We Accomplish This?

Well, the title of this blog post and opening paragraph gives the answer away - we used OpenAI’s GPT-4 😂. We ultimately decided to use it because it allowed us to reduce the time to build a connector as it is able to automatically generate high-quality code, configuration templates, and documentation, significantly speeding up the development process. It assisted us in rapidly iterating through dev cycles, finding potential issues and providing helpful insights, thus greatly reducing the time and effort required for data pipeline building.

By harnessing this capability, we successfully reduced the development time of connectors. By feeding Conduit connector code to GPT-4, we enabled the model to learn and generate connector code from prompts, streamlining the development process. Here are the system prompts we used to direct GPT-4 in building the connector:

  • You are an expert Go developer.
  • Conduit is an open-source data integration tool written in Go.
  • Here is the code for the Conduit Connector SDK for a Source Connector.
  • Here is the code for an example Source Connector for Kafka.
  • Write a source connector for <insert connector you want to build here>. CODE ONLY.

Like magic, GPT-4 generated functional code we were able to use to build connectors. Keep in mind GPT-4 is not flawless. It fell short in cases where the generated code occasionally contained errors due to a lack of context regarding external dependencies, which is sometimes evident in the generated unit tests. While the model typically does a commendable job of rectifying errors with further prompts, developer expertise and intervention are occasionally necessary to address these issues. Keeping that in mind, there are a host of benefits we’ve experienced using GPT-4 such as:

  • Generating functional Go code for Conduit connector within seconds.
  • Receiving guidance on debugging various issues encountered during development.
  • Being able to feed it additional prompts to rewrite and optimize functions.
  • Streamlining development through efficient struct generation for handling deeply nested responses for various APIs, enabling seamless data integration and pipeline building across multiple platforms.
  • Rapidly generate unit tests for input code snippets, which is a significant advantage, as may developers find writing tests tedious.
To see an example of a connector we build using GPT-4 check out our Spire Maritime AIS source data integration connector. If you’re up for the challenge of using GPT-4 for your development efforts, we urge you to try it out!

If you’re interested in learning more about Conduit check out the Conduit documentation, the Conduit API documentation, and the Conduit SDK.

Join the discussion on GitHub or become a part of our community to share your experiences in using GPT-4 to tackle your data integration challenges. We're excited to hear from you!

 

 

 

 

 

     Meroxa, Conduit, Open AI ChatGPT-4

William Hill

William Hill

William is a Sr. Software Engineer @ Meroxa