AI-powered project coordination system with Next.js ChatKit interface and event-driven backend agent for automated GitHub/Jira issue management.
- Next.js application with ChatKit web component
- Session management via
/api/create-session - Configurable prompts, themes, and UI elements
- Optional Redpanda telemetry integration
npm install
cp .env.example .env.localConfigure .env.local:
OPENAI_API_KEY- API key from same org/project as Agent BuilderNEXT_PUBLIC_CHATKIT_WORKFLOW_ID- Workflow ID starting withwf_CHATKIT_API_BASE- (Optional) Custom API endpoint
Start development server:
npm run devAccess at http://localhost:3000. Customize in lib/config.ts and components/ChatKitPanel.tsx.
npm run buildAdd deployment domain to Domain allowlist.
Install KafkaJS:
npm i kafkajsConfigure in .env.local:
REDPANDA_BROKERS- Broker listREDPANDA_SASL_USERNAME/REDPANDA_SASL_PASSWORD- CredentialsREDPANDA_SASL_MECHANISM-scram-sha-256orscram-sha-512REDPANDA_CA_CERT- PEM certificateREDPANDA_TELEMETRY_TOPIC- Topic name (default:chatkit_telemetry)
Test telemetry:
curl -s http://localhost:3000/api/telemetry \
-H 'content-type: application/json' \
-d '{"type":"smoke_test","data":{"hello":"world"}}'Event-driven agent system for automated project coordination via GitHub/Jira webhooks.
GitHub/Jira → Redpanda (issues) → Gateway → AgentKit → Actions
↓
Calendar/Notifications
↓
Redpanda (actions/outcomes)
- Monitors GitHub/Jira issue events
- Applies policy-based routing:
- P0 bugs escalate to platform team
- Frontend issues assign to specialists
- Overdue tasks schedule unblocker meetings
- New issues send triage nudges
- Records actions and outcomes for observability
backend/
├── webhooks/ # GitHub/Jira receivers
├── gateway/ # Event consumer
├── agentkit/ # Mock agent implementation
├── calendar/ # Mock calendar/notification API
├── events/ # Test event publisher
├── samples/ # Sample event files
└── docker/ # Redpanda Docker Compose
Install dependencies:
pip install -r backend/requirements.txtConfigure environment:
cp backend/.env.example backend/.envRequired variables:
PANDA_PROXY- Redpanda Pandaproxy URLAGENTKIT_URL- AgentKit endpointCALENDAR_API_BASE- Calendar service URLGITHUB_WEBHOOK_SECRET- Webhook secret
Start all services:
bash backend/start-all.shServices started:
- Mock Calendar API (port 7300)
- Mock AgentKit Agent (port 8000)
- GitHub Webhook Receiver (port 7000)
- Gateway Consumer (background)
- Redpanda (ports 8082, 19092)
Test event flow:
bash backend/test-flow.shMonitor logs:
tail -f logs/gateway.log
tail -f logs/agentkit.log
tail -f logs/calendar.logMonitor Redpanda topics:
docker compose -f backend/docker/docker-compose.yml exec rpk rpk topic consume actions -n 10
docker compose -f backend/docker/docker-compose.yml exec rpk rpk topic consume outcomes -n 10Stop services:
bash backend/stop-all.shPublish event:
python3 backend/events/publish.py --topic issues --file backend/samples/issue_bug_p0.jsonTest webhook:
curl -X POST http://localhost:7000/github/issues \
-H "X-GitHub-Event: issues" \
-H "X-GitHub-Delivery: test-123" \
-H "Content-Type: application/json" \
-d @backend/samples/issue_bug_p0.jsonIssues Topic:
{
"event_id": "unique-id",
"project_id": "alpha",
"source": "github|jira",
"type": "issue_opened|issue_created|issue_updated",
"repo": "org/repo",
"issue_number": 123,
"title": "Bug description",
"url": "https://...",
"labels": ["bug", "p0"],
"assignee": "username",
"priority": "P0|Highest",
"status": "Open",
"created_at": "2025-10-17T19:22:11Z"
}Actions Topic:
{
"event_id": "a-timestamp",
"project_id": "alpha",
"action": "assign_owner|post_nudge|schedule_unblocker|escalate_owner",
"target": "owner:alice|team:platform",
"rationale": "Reason for action",
"source_ref": "https://github.com/org/repo/issues/123"
}Outcomes Topic:
{
"event_id": "o-timestamp",
"project_id": "alpha",
"risk_delta": -0.2,
"ack": true
}Frontend and backend share the same Redpanda cluster:
- Frontend uses
chatkit_telemetrytopic - Backend uses
issues,actions,outcomestopics
Update backend/.env:
PANDA_CLOUD_BROKERS="cluster.cloud.redpanda.com:9092"
PANDA_CLOUD_USERNAME="username"
PANDA_CLOUD_PASSWORD="password"Modify backend/gateway/consumer.py and webhook receivers to use KafkaJS instead of Pandaproxy REST API.
Edit backend/agentkit/mock_agent.py function apply_undergoing_policy() to modify:
- Escalation vs assignment logic
- Team member routing by label
- Notification thresholds
- Meeting durations
Replace mock agent with production AgentKit by updating AGENTKIT_URL in backend/.env.
Check Redpanda logs:
docker compose -f backend/docker/docker-compose.yml logs redpandaVerify topics:
docker compose -f backend/docker/docker-compose.yml exec rpk rpk topic listCheck consumer lag:
docker compose -f backend/docker/docker-compose.yml exec rpk rpk group describe agent-gwVerify webhook secret in backend/.env matches GitHub configuration.