Architecture overview
The system processes feedback through multiple entry points and uses AI agents to automatically triage and match feedback to feature requests:Key components
Multiple entry points- Slack reactions on customer messages
- Form submissions via web UI
- Direct API integrations
- Semantic search with vector embeddings
- Confidence-based matching (three-tier system)
- Automated request creation
- Area insights generation
- Slack approval workflows for medium-confidence matches
- Manual review for low-confidence feedback
- Notifications and status updates
- PostgreSQL for core data
- Upstash Vector for embeddings
- Redis for workflow state
Tech stack
GTM Feedback uses modern, production-ready technologies:Frontend and framework
- Next.js 16 with App Router for server and client rendering
- Tailwind CSS v4 with shadcn/ui components for styling
- Radix UI for accessible component primitives
- NextAuth v5 with Google OAuth for authentication
Backend and data
- PostgreSQL (Neon) with Drizzle ORM for relational data
- Upstash Vector for storing and searching embeddings
- Redis/Upstash KV for caching and temporary state
AI and workflows
- Workflow DevKit for durable execution and background tasks
- Vercel AI SDK with AI Gateway for agent orchestration
- OpenAI text-embedding-3-small for vector embeddings (384 dimensions)
- Claude Sonnet for area insights, Claude Haiku for search and matching
Integrations
- Slack Bolt with Vercel adapter for Slack app
- SWR for client-side data fetching and caching
Data flow
Here’s how feedback moves through the system from submission to storage:1. Feedback submission
Feedback enters the system through one of three paths:2. Workflow orchestration
TheprocessCustomerFeedback workflow handles all feedback processing:
3. Vector search
Semantic matching uses OpenAI embeddings stored in Upstash Vector:4. Database persistence
All data is stored in PostgreSQL using Drizzle ORM:Apps and packages
The monorepo is organized into apps and shared packages:Apps
apps/www
Next.js web application for feedback collection, request management, and analytics dashboards
apps/slack-app
Slack Bolt app for capturing feedback via reactions and slash commands
Packages
packages/ai
Shared AI agents, tools, and embedding utilities used by both apps
packages/database
Drizzle ORM schema, relations, and database utilities
packages/redis
Redis/Upstash KV client helpers for caching and state
Project structure
The codebase follows a monorepo pattern with clear separation of concerns:Extensibility
The architecture is designed to be adapted to your organization’s needs:Add new AI agents
Add new AI agents
Create new
ToolLoopAgent instances in packages/ai/src/agents/ following the existing patterns. Each agent should have its own directory with index.ts, prompts.ts, and tools.ts.Adjust agent behavior
Adjust agent behavior
Modify prompts and instructions in agent definition files (e.g.,
packages/ai/src/agents/search/prompts.ts).Add new tools for agents
Add new tools for agents
Create new tools in
packages/ai/src/tools/ and export them from the appropriate agent’s tools.ts file.Create new workflows
Create new workflows
Add workflow files to
apps/www/src/workflows/ using the "use workflow" directive and Workflow DevKit patterns.Customize Slack messages
Customize Slack messages
Update message formatting in
apps/slack-app/server/lib/slack/ or adjust the Slack agent’s compose mode.Next steps
Workflows
Learn about durable execution with Workflow DevKit
AI agents
Explore the AI SDK agent architecture
Semantic matching
Understand vector embeddings and confidence scoring
Deploy
Deploy your own instance