AI Engineering

Self-Healing Code

Self-healing code GitHub action pipeline using @LangChainAI and @OpenAI
Check icon
Speed Engineering
Check icon
Hyper-Automate Code Deployment
Check icon
Human in The Loop
Social Media
Analysis
Text Generation
Trend Analysis
Trend Analysis

How it works:

  • Create a workflow for GitHub actions that triggers our healing job when the build command fails.This should pass the error log from the build to the healing job.(Note to self: it's certainly useful to implement a limit to retry mechanisms)
  • Create your python script to run when the build fails and read the error log file on it.
  • Create your human prompt template and pass it to the LLMChain.Mine goes something like this: "Can you find the filename where this error comes from: {error}?  If you do, please reply with the path to the file ONLY, if not please reply with no."
  • Run the LLMChain to return the pathname and check if the filename was detected. Then read the contents of the file.
  • We want to make sure GPT returns meaningful, structured code, so I created a ResponseSchema that contains if a fix was found and the fixed content.
  • Create a prompt template with your structured response schema and the request for GPT to fix the code.
  • Run the LLMChain again with the prompt and parse it using your created OutputParser.
  • Write the returned code to the file and commit using the action.
  • This is an early prototype and works on single file errors only for now, but the potential to improve CI/CD pipelines and implications to DevOps is huge.

A newsletter for people
building at the edge.

Keep up with the tips, tricks, & tools of titans across emerging tech, artificial intelligence, generative media, and design. Delivered daily. Created by people. Orchestrated by agents.

Banger! AI says Hi.
Oops! Something went wrong while submitting the form.

Get a free
AI assessment.

Partner with us. Our collaboration can extend your reach and deepen the impact. Let's innovate together.

Contact  ->