Module 90: AI Application Project
Integration
🏠The everyday picture
A new hire becomes useful when they're part of the team's daily tools: on the office chat, with access to the right files, in the right meetings. Brilliant but disconnected helps nobody.
📘What it really is
- Put the parts together into one application, following the architecture from Module 81:
React assistant page (inside the CRM, behind login)
→ POST /v1/assistant/ask (auth, role, rate and size limits, kill-switch flag)
→ standalone question rewrite (for follow-ups)
→ hybrid retrieval with permission and status filters → rerank → top passages
→ grounded prompt (versioned template) + read-only tools (customer summary)
→ model API (streaming, typed errors, cost logging)
→ checks: citations valid, numbers supported, faithfulness for flagged topics
→ stream answer + sources to the page; save to the conversation log (masked)
→ draft_followup_email tool → pending action → approvals page → send on approval
n8n: re-index on document change, review-date reminders, daily quality report
- Engineering standards from earlier levels still apply:
- TypeScript types and Zod validation throughout (Level 4);
- repositories and parameterised SQL (Level 5);
- tests: unit tests for chunking and checks; API tests for permissions and limits; the eval suite for quality (Module 89);
-
configuration for model names, limits and prompt versions; secrets in the secrets store (Module 77).
-
User experience:
- make it clear it's an AI assistant, with sources on every answer and a short note that answers can be wrong;
- suggested example questions; a "couldn't find it" answer that points to who to ask;
- feedback buttons; a way to report a harmful or wrong answer;
-
fast feedback (streaming) and graceful messages when it's unavailable (Module 84).
-
Accessibility and language: keyboard and screen-reader friendly (Module 37); test with the languages staff actually use.
🖱️Try it
Integrate your assistant fully into your CRM, following the diagram. Write the missing tests: permission tests for retrieval and tools, limits tests for the route, and unit tests for chunking and citation checks. Run your full eval suite and fix failures until safety and permission cases pass completely.
✅Quick check
Where in the flow are permissions enforced?
Show the answer
At the route (login and role), in retrieval filters, inside every tool, and again when approving actions.
Why show sources and a short accuracy note on every answer?
Show the answer
So users can check answers and don't over-trust them.
