Objective
- Give internal staff in every Attik instance an in-platform AI knowledge base assistant that answers questions from company guidance instead of scattered Google Docs and external references.
- Replace the early Scott-only prototype with a maintainable, multi-tenant solution that Southwest, Southeast, and other regions can adopt.
- Keep guidance authoritative and instance-specific — each company's handbook/helpdocs and AI sources feed answers for that company only.
Background
- Southwest and Southeast asked for the AI knowledge base bot that exists in Scott's instance, so operational information lives in one place inside Attik.
- The current bot was built early, has not been maintained, and likely needs a ground-up rebuild using newer platform tools (per engineering review).
- Priority: real request, but lower than dispatch — track separately and sequence accordingly.
- Triage verdict: Feature gap — the bot is not broken in other instances; it was never rolled out beyond Scott.
- Today, Scott staff see an AI Assistant star button in the global navbar; other instances do not.
- The chat proxies to an external Scott-specific agent service; backend AIChunk vector search and helpdoc sync are already company-scoped and are the likely foundation for a rebuilt bot.
Scope
Frontend (attik-frontend)
- Global navbar AI entry point:
src/components/navbar/GlobalSearch.tsx — AI Assistant button and AISearchInput are gated to Scott's _companyId (624c9327e90fc4025d8f586b) only.
- Chat UI:
src/components/navbar/AISearchInput.tsx, src/components/navbar/AIModal.tsx — streams answers via POST /api/ai-chat.
- API proxy:
src/app/api/ai-chat/route.ts — forwards to scott-chatbot-production.up.railway.app/api/scott-agent (Scott-named external service).
- Knowledge source admin:
src/app/tools/ai/sources/page.tsx and related components — browse/manage AI knowledge sources per company (not Scott-gated).
- Handbook / helpdocs authoring:
src/app/tools/handbook/[[...id]]/ — company content that can feed the knowledge base.
Backend (attik-backend)
- Vector search:
src/routes/aiChunk.ts — $vectorSearch on AIChunk filtered by _companyId and access.
- Helpdoc → chunk sync:
src/util/functions/ai/syncHelpdocsToAIChunks.ts and src/events/bullmq/helpdocsWorker.ts — embeds handbook/helpdoc content per company.
- Chunk model:
src/models/AIChunkSchema.ts — stores embeddings, source, collection (helpdocs, etc.), company id.
- Separate AI assist paths (report skin / client portal) use similar chunk infrastructure in
src/routes/reportChunk.ts — related but different user-facing surfaces.
Out of scope (unless explicitly expanded)
- Client portal AI (recommendations, Q&A for homebuyers/agents) — see ATT-755, ATT-1183.
- Report-skin Agent Assist chatbot — separate surface; see ATT-1087 and related AI Features work.
- Migrating all legacy Google Docs content into Attik (content migration may be a prerequisite project, not part of the bot shell alone).
References
- Overlapping backlog item: ATT-231 — Contextful AI Chat Built Into New Searchbar (same outcome: replicate Scott chatbot to all instances).
- AI Features project issues: ATT-1181 (usage analytics), ATT-1087 (KB grounding for agent assist).
- Frontend entry:
attik-frontend/src/components/navbar/GlobalSearch.tsx, attik-frontend/src/app/api/ai-chat/route.ts
- Backend entry:
attik-backend/src/routes/aiChunk.ts, attik-backend/src/util/functions/ai/syncHelpdocsToAIChunks.ts
Decisions needed
- Relationship to ATT-231 — Should ATT-1875 supersede ATT-231, or should they be linked as duplicate tracking for the same outcome?
- Rollout scope — Enable for all instances at once, or pilot with Southwest + Southeast first?
- Agent architecture — Replace the Scott Railway
scott-agent service with a company-aware Attik agent (using AIChunk + vector search), or extend/wrap the existing external service per instance?
- Content source of truth — Which sources must v1 answer from: Handbook / Helpdocs only, AI Sources uploads, both, and/or migrated Google Docs?
- Content readiness — Is each requesting instance expected to populate handbook/helpdocs first, or does Attik provide seed/migration support before the bot goes live?
- Access control — All logged-in tools users, or a specific role/permission (e.g. office staff only)? Who can manage knowledge sources vs consume the bot?
- UI placement — Keep the current global navbar star button pattern, or relocate (e.g. handbook sidebar, dedicated AI page)?
- Analytics in v1 — Include basic usage logging (questions asked, adoption) per ATT-1181, or defer to a follow-up?
- Priority / sequencing — Confirm this stays below dispatch and set a target milestone or "no date" until dispatch work clears.