Feb 18, 2026
Learn how to automatically respond to Github Issues with AI.


Every open source project or developer tool eventually hits the same wall: your GitHub Issues queue becomes a support forum, and your team spends hours answering questions that your documentation already covers. Maintainers burn out. Response times slip. Users feel ignored.
What if your repo could answer common questions automatically - in seconds, from your own docs - the moment a new issue lands?
In this tutorial, you'll build a GitHub Action that listens for new issues, queries the Kapa API with the issue content, and posts an AI-generated answer as a comment. The whole setup takes under 20 minutes, requires no extra infrastructure, and works entirely within GitHub's native tooling.
What We're Building
Here's the flow end-to-end:
A user opens a new GitHub Issue
A GitHub Actions workflow triggers on the `issues.opened` event
The workflow sends the issue title and body to the Kapa API
Kapa searches your ingested documentation and generates a relevant answer
The workflow posts that answer as a comment on the issue, with a note that it was AI-generated
The result: users get an instant, docs-grounded first response while your team reviews the issue in parallel.
Requirements
Before you start, make sure you have:
A Kapa account with a project set up and your documentation already ingested.
Your Kapa API credentials - specifically a Project ID, Integration ID and an API key.
A GitHub repository where you have admin access (to add secrets and create workflow files).
Basic familiarity with GitHub Actions YAML syntax.
Step 1: Get your Kapa credentials
Log into your Kapa dashboard and navigate to your project settings. You'll need two values:
Project ID - the unique identifier for your Kapa project, this can be found as the first ID within the URL for the dashboard
Integration ID - the unique identifier for your Kapa integration, create a new "Custom (via API)" integration within the integrations section of the Kapa dashboard
API Key - your secret key for authenticating requests to the Kapa API, navigate to "API Keys" within the Kapa dashboard
Keep these handy - you'll be adding them as GitHub secrets in the next step.
Step 2: Add secrets to your Github Repository
Never hard-code credentials in workflow files. GitHub Secrets are the right place for sensitive values.
Go to your GitHub repository
Click Settings > Secrets and variables > Actions
Click New repository secret and add the following three secrets:
KAPA_PROJECT_ID - your Project ID
KAPA_INTEGRATION_ID - your Integration ID
KAPA_API_KEY - your API key
We'll reference these later within the GitHub Action.
Step 3: Create the GitHub Actions Workflow
In your repository, create the following directory structure if it doesn't already exist:
Then, add the workflow file below, we'll walk through each section after the full example.
Breaking down the script
Triggering the action
This action triggers on issues.opened - anytime a new issue was opened within your repository.
This will only fire when a new issue is created, not when an issue is updated, edited, labeled or commented on.
Check the labels
There may be certain labels that you might not want an automated answer going out on - for example, 'bug' or 'feature request'. You can add as many labels to skip as you'd like with this line of code built into the Action:
Calling the Kapa API
Now for the important part - calling the Kapa API, giving it the context that it needs to generate a response. This part takes the query that's been generated by the issue title and body, along with the integration_id for your own analytics, and passes this to the /chat endpoint.
Posting the comment back to the issue
Once the response has been generated by Kapa and returned to the Action, this will get posted in the thread. A helpful disclaimer is already built into the script above to clarify that the response is an automatically generated response in the event of the response not being sufficient, or a human needing to step in to add additional context.
Customisation ideas
There are a tonne of ways you could customise this to make it your own, here are some ideas:
Add a reaction before the comment is posted: use
github.rest.reactions.createForIssueto add a 👀 emoji the moment the issue opens so users know that it's being looked at - even before Kapa responds. Be wary of this if you are skipping responses based on labels, your reactions should take this into consideration, too!Gate on issue length: consider adding a minimum issue length before triggering Kapa - a query such as "help", "doesn't work" or "it's broken" likely won't generate a helpful response from Kapa.
Close issues Kapa answers confidently: Kapa returns an
is_uncertainattribute with it's responses, if this isfalsethis means that Kapa is confident the response was accurate, consider closing certain issues when this is set tofalse. Testing should be completed before rolling this out more widely.
Conclusion
With about 50 lines of YAML and JavaScript, you now have a self-service support layer built directly into your GitHub Issues workflow. Users get instant, documentation-grounded answers. Your team gets breathing room to focus on issues that actually need a human. And your docs get put to work in the most direct way possible: answering real questions from real users, in the exact moment they're asking.
The best part? Every issue that Kapa handles successfully is a data point about what your users are struggling to find in your docs - a feedback loop that makes your documentation better over time.

Turn your knowledge base into a production-ready AI assistant
Request a demo to try kapa.ai on your data sources today.
