Kong AI + API Gateway Hackathon
Last updated
Last updated
This template is produced to give the participants in the Kong AI + Gateway Hackathon a flying start. This template includes a basic infrastructure configuration, so all they need to do is to integrate with Kong Konnect and Opper AI, before starting to build the functionality that they want to demo.
The objective for the hackathon is to explore how to build systems using an AI-powered API Gateway and agents that are specialized to handle different types of requests.
The Kong Gateway connected with a complete API (written in Python) with persistent chats stored in Couchbase, a knowledge base, and a full LLM integration through Opper AI.
A frontend (written in React) that provides a chat interface for users to interact with the API.
A great container-based dev env on Polytope, including hot reload, that makes it easy to iterate and collaborate on your solution. One command and you and all your team members are up and running with the same environment!
While this is a great starting point, we don't want to do all the work for you, so the implementation is intentionally incomplete. Here are some known issues you'll need to address:
The bot is very unhelpful!
The knowledge base is limited and not very useful.
The bot hallucinates a lot! If it can't find the answer in the knowledge base, it just makes stuff up.
Make sure you have all of the Cillers System Demo Template prerequisites installed:
Clone the template repo:
Click "Gateway Services" in the left sidebar. Click "New gateway service".
Click the “Routes” tab. Click “New route”.
Select Specify “/api”, "/docs", "/redoc" and "/openapi.json" as Paths. Click “View Advanced Fields” and uncheck "Strip Path". Click "Save"
Click "Gateway Services". Click "New gateway service".
Click the "Routes" tab and then "New route".
Specify "frontend-route" as Name, "/" as Paths. Click "View Advanced Fields". Uncheck "Strip Path". Click "Save".
Click "Gateway Services". It should now look as follows:
Run the following command in your demo project directory: pt run stack
Start building your solution!
This app has two main components:
The API - A Python FastAPI backend that handles chat session management, knowledge base querying, and Opper AI integration
The UI - A React TypeScript frontend that provides the user interface
The API follows a RESTful design with the following endpoints:
POST /api/chats
- Create a new chat session
GET /api/chats/{chat_id}
- Get a chat session by ID
GET /api/chats/{chat_id}/messages
- Get all messages for a chat session
POST /api/chats/{chat_id}/messages
- Add a message to a chat session and get a response
DELETE /api/chats/{chat_id}
- Delete a chat session and all its messages
Example usage:
Follow the .
Follow the .
Go to your Kong Konnect Gateway Manager:
Specify as Full URL, and "api" as Name. Click “Save”.
Specify as Full URL, and "frontend" as Name. Click “Save”.
Open the UI: