An AI-powered chat interface that acts as a knowledgeable sales representative for the Kognitos platform. Built with Next.js, Claude API, and styled with the Kognitos brand identity.
- Intelligent Sales Conversations: Powered by Claude, trained on Kognitos marketing content
- Streaming Responses: Real-time message streaming for a natural chat experience
- Rate Limiting: IP-based throttling (50 messages/hour) to prevent abuse
- Chat Session Recording: All conversations saved to Supabase for analytics
- Kognitos Branding: Dark theme with signature yellow accents, IBM Plex Mono typography
- Mobile Responsive: Works seamlessly on all device sizes
- Framework: Next.js 14 (App Router)
- AI: Anthropic Claude SDK
- Styling: Tailwind CSS v4
- Rate Limiting: Supabase (Postgres)
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- Anthropic API key
-
Clone the repository:
cd koggie_gtm npm install -
Copy the environment variables:
cp .env.example .env.local
-
Add your Anthropic API key to
.env.local:ANTHROPIC_API_KEY=sk-ant-api03-xxxxx -
Run the development server:
npm run dev
Place markdown files in the /content directory. The AI will use this content as its knowledge base when answering questions.
Example content files:
about-kognitos.md- Company overviewfeatures.md- Product featurespricing.md- Pricing informationuse-cases.md- Customer use casesfaq.md- Frequently asked questions
The content is automatically loaded and injected into Claude's context.
git add .
git commit -m "Initial commit"
git push origin main- Go to vercel.com
- Import your GitHub repository
- Add environment variables:
ANTHROPIC_API_KEY: Your Anthropic API key
- In your Vercel project dashboard, go to Storage
- Click Create Database → Select Supabase from Marketplace
- Follow the setup wizard to create a Postgres database
- The
SUPABASE_URLandSUPABASE_ANON_KEYwill be automatically added - Go to your Supabase dashboard → SQL Editor
- Run the SQL from
supabase/schema.sqlto create the rate_limits table
The application limits users to 50 messages per hour per IP address. This is handled by Supabase in production.
In development (without Supabase configured), rate limiting is disabled and all requests are allowed.
All chat sessions are recorded in Supabase with:
- chat_sessions: Session metadata (IP, user agent, timestamps, message count)
- chat_messages: Individual messages with role, content, and timestamps
Query examples:
-- Recent sessions with message counts
SELECT * FROM chat_sessions ORDER BY started_at DESC LIMIT 50;
-- All messages from a session
SELECT * FROM chat_messages WHERE session_id = 'uuid-here' ORDER BY created_at;
-- Daily session counts
SELECT DATE(started_at), COUNT(*) FROM chat_sessions GROUP BY DATE(started_at);Edit the SALES_SYSTEM_PROMPT in /lib/claude.ts to adjust the AI's personality and behavior.
Modify the RATE_LIMIT constant in /lib/rate-limiter.ts.
All brand colors are defined as CSS custom properties in /app/globals.css.
koggie_gtm/
├── app/
│ ├── api/chat/route.ts # Claude streaming endpoint
│ ├── globals.css # Kognitos theme
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main chat page
├── components/
│ ├── chat/
│ │ ├── ChatContainer.tsx
│ │ ├── ChatInput.tsx
│ │ ├── MessageBubble.tsx
│ │ └── MessageList.tsx
│ └── ui/
│ └── Logo.tsx
├── content/ # Marketing content (markdown)
├── lib/
│ ├── claude.ts # Claude client & prompts
│ ├── content-loader.ts # Loads marketing content
│ └── rate-limiter.ts # Vercel KV rate limiting
└── public/
└── favicon.svg # Kognitos logo
Proprietary - Kognitos, Inc.