Files
konstruct/.planning/REQUIREMENTS.md

132 lines
6.2 KiB
Markdown

# Requirements: Konstruct
**Defined:** 2026-03-23
**Core Value:** An AI employee that works in the channels your team already uses — no new tools to learn, no dashboards to check, just a capable coworker in Slack or WhatsApp.
## v1 Requirements
Requirements for beta-ready release. Each maps to roadmap phases.
### Channel Infrastructure
- [x] **CHAN-01**: Channel Gateway normalizes messages from all channels into unified KonstructMessage format
- [ ] **CHAN-02**: User can interact with AI employee via Slack (Events API — @mentions, DMs, thread replies)
- [ ] **CHAN-03**: User can interact with AI employee via WhatsApp Business Cloud API
- [ ] **CHAN-04**: WhatsApp adapter enforces business-function scoping per Meta 2026 policy
- [ ] **CHAN-05**: Platform rate-limits requests per tenant and per channel with configurable thresholds
### Agent Core
- [ ] **AGNT-01**: Tenant can configure a single AI employee with custom name, role, and persona
- [ ] **AGNT-02**: Agent maintains conversational memory within sessions (sliding window)
- [ ] **AGNT-03**: Agent retrieves relevant past context via vector search (pgvector long-term memory)
- [ ] **AGNT-04**: Agent can invoke registered tools to perform actions (tool registry + execution)
- [ ] **AGNT-05**: Agent escalates to human when configured rules trigger, transferring full conversation context
- [ ] **AGNT-06**: Every agent action (LLM call, tool invocation, handoff) is logged in an audit trail
- [ ] **AGNT-07**: Agent token usage is tracked per-agent per-tenant with configurable budget limits
### LLM Backend
- [x] **LLM-01**: LiteLLM router abstracts LLM provider selection with fallback routing
- [x] **LLM-02**: Platform supports Ollama (local) and commercial APIs (Anthropic, OpenAI) as LLM providers
- [ ] **LLM-03**: Tenant can provide their own API keys for supported LLM providers (BYO keys, encrypted at rest) ⚠️ CONFLICT: listed as v1 here but out-of-scope in PROJECT.md — resolve before Phase 3 planning
### Multi-Tenancy & Security
- [x] **TNNT-01**: All tenant data is isolated via PostgreSQL Row Level Security
- [x] **TNNT-02**: Inbound messages are resolved to the correct tenant via channel metadata
- [x] **TNNT-03**: Per-tenant Redis namespace isolation for cache and session state
- [x] **TNNT-04**: All data encrypted at rest (PostgreSQL, object storage) and in transit (TLS 1.3)
### Admin Portal
- [ ] **PRTA-01**: Operator can create, view, update, and delete tenants
- [ ] **PRTA-02**: Operator can design agents via a dedicated Agent Designer module — defining job description, statement of work, persona, system prompt, tool assignments, and escalation rules
- [ ] **PRTA-03**: Operator can connect messaging channels (Slack, WhatsApp) via guided wizard
- [ ] **PRTA-04**: New tenants are guided through structured onboarding (connect channel, configure agent, test message)
- [ ] **PRTA-05**: Operator can manage subscription plans and billing via Stripe integration
- [ ] **PRTA-06**: Portal displays agent cost tracking and usage metrics per tenant
## v2 Requirements
Deferred to future release. Tracked but not in current roadmap.
### Channel Expansion
- **CHAN-06**: User can interact with AI employee via Microsoft Teams
- **CHAN-07**: User can interact with AI employee via Mattermost
- **CHAN-08**: User can interact with AI employee via Telegram
### Agent Advanced
- **AGNT-08**: Same agent maintains unified memory across Slack and WhatsApp (cross-channel identity)
- **AGNT-09**: Agent detects negative sentiment and proactively escalates before user requests it
- **AGNT-10**: Pre-built tool integrations for common SMB tools (Zendesk, HubSpot, Google Calendar)
### Multi-Agent Teams
- **TEAM-01**: Coordinator agent routes inbound messages to specialist agents
- **TEAM-02**: Specialist agents execute domain-specific tasks and return results to coordinator
- **TEAM-03**: All inter-agent communication logged for audit
### Enterprise
- **ENTR-01**: Schema-per-tenant isolation for Team tier
- **ENTR-02**: Self-hosted deployment via Helm chart and Docker Compose
- **ENTR-03**: Agent marketplace with pre-built role templates
## Out of Scope
| Feature | Reason |
|---------|--------|
| Voice/telephony channels (Twilio) | Completely different tech stack and regulatory environment; validate messaging first |
| Open-ended general-purpose WhatsApp bot | Banned by Meta (Jan 2026 policy); agents must serve specific business functions |
| Real-time token streaming in chat | Slack/WhatsApp don't support partial message streaming; zero user benefit |
| Full no-code visual agent builder (drag-and-drop) | Agent Designer covers structured text-based configuration; visual flow builders are premature |
| Cross-tenant agent communication | Security/isolation violation; no compliance framework supports it |
| Dashboard-first UX for end users | Defeats core value proposition; agent interactions stay in messaging channels |
| White-labeling for agencies | Secondary market; validate direct SMB first |
| AI company hierarchy (teams of teams) | Requires proven multi-agent foundation; v3+ |
| SOC 2 / HIPAA compliance | Post-revenue; self-hosted option covers compliance-sensitive customers |
## Traceability
Which phases cover which requirements. Updated during roadmap creation.
| Requirement | Phase | Status |
|-------------|-------|--------|
| CHAN-01 | Phase 1 | Complete |
| CHAN-02 | Phase 1 | Pending |
| CHAN-03 | Phase 2 | Pending |
| CHAN-04 | Phase 2 | Pending |
| CHAN-05 | Phase 1 | Pending |
| AGNT-01 | Phase 1 | Pending |
| AGNT-02 | Phase 2 | Pending |
| AGNT-03 | Phase 2 | Pending |
| AGNT-04 | Phase 2 | Pending |
| AGNT-05 | Phase 2 | Pending |
| AGNT-06 | Phase 2 | Pending |
| AGNT-07 | Phase 3 | Pending |
| LLM-01 | Phase 1 | Complete |
| LLM-02 | Phase 1 | Complete |
| LLM-03 | Phase 3 | Pending |
| TNNT-01 | Phase 1 | Complete |
| TNNT-02 | Phase 1 | Complete |
| TNNT-03 | Phase 1 | Complete |
| TNNT-04 | Phase 1 | Complete |
| PRTA-01 | Phase 1 | Pending |
| PRTA-02 | Phase 1 | Pending |
| PRTA-03 | Phase 3 | Pending |
| PRTA-04 | Phase 3 | Pending |
| PRTA-05 | Phase 3 | Pending |
| PRTA-06 | Phase 3 | Pending |
**Coverage:**
- v1 requirements: 25 total
- Mapped to phases: 25
- Unmapped: 0
---
*Requirements defined: 2026-03-23*
*Last updated: 2026-03-23 after roadmap creation — traceability complete*