GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Chafficui/kody: Open-source embeddable AI chat assistant widget

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
packages
packages
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
CLAUDE.md
CLAUDE.md
 
 
Dockerfile.server
Dockerfile.server
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
docker-compose.prod.yml
docker-compose.prod.yml
 
 
docker-compose.yml
docker-compose.yml
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.base.json
tsconfig.base.json
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

Kody

Kody

Open-source embeddable AI chat assistant for any website.
One script tag. Your AI. Your branding. Your rules.

CI MIT License


What is Kody?

Kody lets you add a fully branded AI chat assistant to any website with a single <script> tag. You control which AI backend powers it (any OpenAI-compatible API), what topics it covers, how it looks, and where tickets go when it can't help.

  • Bring your own AI — Works with OpenAI, Ollama, vLLM, llama.cpp, or any OpenAI-compatible endpoint
  • Three-layer guardrails — Input filtering, system prompt enforcement, and output scrubbing keep conversations on-topic
  • No AI branding — Provider names (ChatGPT, Claude, Llama, etc.) are automatically scrubbed from responses
  • Full customization — Colors, name, logo, welcome message, position, and more
  • Shadow DOM isolation — Widget styles never leak to or from the host page
  • Ticket creation — Connect Jira, GitHub Issues, Linear, email, or a custom webhook
  • Knowledge sources — Feed your assistant context via text, FAQ, URLs, or files
  • Admin dashboard — Manage sites, branding, guardrails, and knowledge through a built-in UI at /admin

Quick Start

Docker (recommended)

git clone https://github.com/Chafficui/kody.git
cd kody
docker compose up -d

This starts the Kody server on port 3456 with Ollama as the AI backend. Open the admin dashboard at http://localhost:3456/admin and log in with the default credentials ([email protected] / changeme).

Create a site, then embed the widget on any page:

<script src="http://localhost:3456/widget.js" data-site-id="your-site-id" async></script>

Manual

git clone https://github.com/Chafficui/kody.git
cd kody
pnpm install
pnpm build

Set the required environment variables (see .env.example), then start the server:

cd packages/server
node dist/index.js

Architecture

Pnpm monorepo with 4 packages:

packages/
  shared/   — Zod schemas, TypeScript types, constants
  server/   — Express 5 API server, guardrails engine, admin API, SQLite database
  widget/   — Shadow DOM chat bubble (vanilla TS, Vite IIFE build, ~15KB gzipped)
  admin/    — Vite SPA dashboard served by the server at /admin

How it works

┌──────────┐     ┌──────────────┐     ┌──────────────┐
│  Widget   │────▶│  Kody Server │────▶│  AI Provider │
│ (browser) │◀────│  (Express 5) │◀────│  (your API)  │
└──────────┘ SSE └──────────────┘     └──────────────┘
                   │ ▲
                   │ │  Guardrails:
                   │ │  1. Input filter (injection, patterns, length)
                   │ │  2. System prompt (topic enforcement + knowledge)
                   │ └─ 3. Output scrubber (AI names, prompt leaks)
                   │
                   ▼
                 SQLite (sites, users, sessions)

Configuration

Sites are configured through the admin dashboard at /admin or via the REST API.

Each site has:

Section What it controls
Branding Name, tagline, logo, colors, position, welcome message
AI Provider URL, API key, model, temperature, max tokens
Guardrails Allowed topics, refusal message, blocked patterns, prompt injection detection
Knowledge Text snippets, FAQs, URLs, files injected into context
Tickets Jira, GitHub, Linear, email, or webhook for escalation
Rate Limits Per-IP messages per minute/hour/day

Development

pnpm install          # install all dependencies
pnpm run dev          # start all dev servers in parallel
pnpm test             # run all tests (vitest)
pnpm run typecheck    # type-check all packages
pnpm run format       # format with prettier

Running tests

pnpm test             # all tests
pnpm test -- --watch  # watch mode

338 tests covering validators, guardrails, middleware, routes, widget components, and utilities.

Environment Variables

Variable Default Description
PORT 3456 Server port
DATABASE_PATH ./kody.db SQLite database file path
ADMIN_EMAIL — Initial admin user email (first boot)
ADMIN_PASSWORD — Initial admin user password (first boot)
NODE_ENV development Environment

Docker

Development (with Ollama):

docker compose up -d

Production:

docker compose -f docker-compose.prod.yml up -d

Security

  • API keys and secrets are stored server-side only and never sent to the browser
  • Widget authentication uses siteId + browser-enforced Origin header validation
  • Admin authentication uses argon2 password hashing and httpOnly session cookies
  • Three-layer guardrail system protects against prompt injection and off-topic usage
  • No eval(), no innerHTML, no inline event handlers in the widget

Documentation

Full documentation is available at kody.codai.app/docs.

License

MIT — use it for anything.

About

Open-source embeddable AI chat assistant widget

kody.codai.app

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.