Cillers Documentation
  • Introduction
  • PREREQUISITES
  • Hardware And Operating System
  • Polytope
    • Installation For MacOS Users
    • Installation For Windows Users
    • Installation For Linux Users
  • INTEGRATIONS
    • Couchbase Capella
    • Kong Konnect
    • Opper AI
  • CILLERS SYSTEM DEMO TEMPLATES
    • Kong AI + API Gateway Hackathon
Powered by GitBook
On this page
  • Objective
  • A Starting Point For Your Demo Project
  • Installing Your Demo Project
  • Configure Your Kong Services And Routes
  • Add The "api" Service
  • Add The "frontend" Service
  • Start Your Demo
  • Project Structure
  1. CILLERS SYSTEM DEMO TEMPLATES

Kong AI + API Gateway Hackathon

PreviousOpper AI

Last updated 21 days ago

Objective

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.

A Starting Point For Your Demo Project

  • 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.

Installing Your Demo Project

Make sure you have all of the Cillers System Demo Template prerequisites installed:

Clone the template repo:

git clone https://github.com/Cillers-com/kong-ai-gateway-hackathon.git kong-demo && cd kong-demo

Configure Your Kong Services And Routes

Add The "api" Service

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"

Add The "frontend" Service

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:

Start Your Demo

  1. Run the following command in your demo project directory: pt run stack

  2. Start building your solution!

Project Structure

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:

# Create a new chat session
curl -X POST http://localhost:8000/api/chats -H "Content-Type: application/json" -d '{}'

# Get chat details (replace UUID with the one from previous response)
curl http://localhost:8000/api/chats/550e8400-e29b-41d4-a716-446655440000

# Send a message and get a response
curl -X POST http://localhost:8000/api/chats/550e8400-e29b-41d4-a716-446655440000/messages \
  -H "Content-Type: application/json" \
  -d '{"content": "What is your return policy?"}'

# Get chat history
curl http://localhost:8000/api/chats/550e8400-e29b-41d4-a716-446655440000/messages

# Search knowledge base
curl 'http://localhost:8000/api/knowledge-base/search?query=warranty'

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:

Hardware and Operating System
Polytope
Kong Konnect integration guide
Opper AI integration guide
https://cloud.konghq.com/us/gateway-manager/
http://host.docker.internal:3001
http://host.docker.internal:3002
http://localhost:8000