Next.js AI Knowledge Assistant
2026-02-202 turns11,609 charsgpt-5-mini
Summary
User wants a coding plan for a Next.js AI knowledge assistant to prepare for a Meta job blocker test.
Messages
write out a plan to code this using next.js 16+ : Another blocker test for the Meta job. They give you a message saying that quality has been on the decline overall for the company so they are doing more blocker tests which you get two tries on and if you fail you are fired. They have been doing these at least once a week now. I only have two reviews on my work there and they were both a 0 so my overall score is a 0 and they want you to be above a 2 or else they fire you eventually.
The Meta job though is most of my income right now. It pays $17 an hour and you can do as much as you want, that is if you don’t have a blocker test holding you up. You end up paying through the nose on taxes for it later, but that is my main source of income.
The Google job has been lackluster. You can only work when there are tasks available. Task availability is not constant so very often when you want to work there are no tasks available and when you do not want to work or are sleeping there is work. It pays $14.50 an hour and I have yet to get the 9 hour minimum required for the job per week.
So I have concluded that I need to prioritize getting a new source of income.
ChatGPT seems to think that I should be able to get work. I have been thinking with it and have thought of a plan of action.
I decided that work that would feel good at the end of the day working with AI looks like helping non-profits achieve more efficiency as they have more budgetary constraints. ChatGPT suggested working for Medical Spas but that idea, the idea of those “Wives of West-Lake” getting lipo-suction more efficiently as the key contribution of my work to society just seemed like too much of a trade off.
So I thought what is a big problem that non-profits have?
Siloed information. Compartmentalized in the form of senior workers having control over key aspects and being irreplaceable because they carry with them the ability, skills and knowledge to get the job done.
So what I have to offer is a tool. An AI tool which not only centralizes the information and makes it easier to teach new hires SOP and other concerns, but it can act as a constantly updating knowledge resource which grows as the business develops.
The key innovation is the detection of edge cases. So the agent will look up an answer from the knowledge base and if it can not find the answer then instead of doing a search for it online you would simply reconfigure that same logic to create a hook to call a service to generate a message to the relevant member of the business who would have access to that information.
So a sample workflow.
New employee for X department has a question about SOP and asks the chatbot software I created. The chatbot then searches the knowledge base of all of the information ingested into the chatbot from the organization from initial set up but the key innovation is how it updates itself.
Edge cases. This is the key differentiator. Rather than hallucinate or search on the web for an answer when there is an edge case, what my bot does instead is it sends a message, using telegram or other messaging services, that is directed to the appropriate party, that is first it categorizes the problem into the department structure of the company to determine who would be able to answer the question. Then it sends the question to the senior member who can answer the question and then the answer is ingested into the knowledge base so that future queries about that aspect of SOP will have the answer.
The edge cases can be tracked as to their status of answer and when an answer is created and ingested the original new employee can receive a message with the updated SOP.
By adding a human in the loop I think this would differentiate the chatbot I would have the ability to build for a client.
So the plan.
I think a non-profit I could get behind is low income housing. Such as the place I live. I know the set up for their system. They have only a few employees. I could focus on just the two positions of the front desk person and the back desk manager. It has a senior and junior employee so it would be a microcosm of what I would build for some larger organization.
The way it would work is that it would be a simple website the worker would have access to. Just them. And it is just a chatbot. They can ask it questions about work. It will search the knowledge graph I created and respond with sourced answers using my methods. If the chatbot does not know the answer it will send a message to the back office manger. When the back office manager answers the question it will send a message to the front desk worker with the answer as well as update the app so any future person will get the correct answer.
And that is it. That is all the app will do.
But when you integrate this with a larger organization you can see how much more complex it would become.
That is how I will make money. By setting this up for a larger organization I can justify the expense to them as a one time set up, since there would be little to no upkeep once set up, and they can justify it as freeing up time for training new employees. Managers will like it because they can focus more on their work than training new employees.
So first I will start with Los Portales, where I live. I can take my time, even though I don’t have a lot, and ask them a lot of questions, since I know them and have easy access to them, and I can test the application with them. This ability to test and get free feedback along with a good testimonial would be all the payment I would ask from them.
Then I could ask the city for a grant to do this work for other low income housing places, such as where I used to live at Green Doors, or other small time organizations which do not have a lot of resources.
The non-profits do not have much money, but possibly I could write grants to charitable organizations to pay for this work.
Or more likely, I will end up creating efficiency for Med-Spas and spend my days creating artificial intelligence for artificial people.
Here’s a structured plan for how you could start coding this AI-driven knowledge assistant in **Next.js 16+**, focusing on your microcosm with Los Portales as a test environment. I’ve broken it down step by step, from architecture to concrete implementation ideas:
---
## **1. Define the Architecture**
**Goal:** Build a simple, extensible chatbot app for a non-profit organization to centralize knowledge and handle edge cases.
**Core Components:**
1. **Frontend (Next.js 16+)**
- Chat interface for employees to ask questions.
- Admin view for managers to answer edge cases.
- Display status of pending edge cases (optional at first).
2. **Backend (API Routes in Next.js or separate serverless functions)**
- Knowledge base query handling.
- Edge case detection & routing logic.
- Messaging/notification integration (Telegram, email, or Slack).
3. **Database / Knowledge Storage**
- Could start with **SQLite**, **PostgreSQL**, or **Supabase**.
- Tables:
- `questions`: id, text, asked_by, status (answered/pending)
- `answers`: id, question_id, text, answered_by, timestamp
- `knowledge_base`: id, topic, content, last_updated
- `users`: id, name, role (front desk, manager), contact info
- `edge_cases`: id, question_id, routed_to, resolved
4. **AI Layer**
- Could be a locally hosted LLM or API call.
- Handles:
- Parsing questions
- Searching knowledge base
- Deciding if the question is an edge case
- Formatting responses
5. **Notification System**
- Messaging to senior employees when a question can’t be answered automatically.
- Could integrate with **Telegram Bot API** or **email**.
- Incoming response gets ingested back into the knowledge base automatically.
---
## **2. Next.js Frontend Structure**
**Pages / Components:**
```
/pages
index.tsx → Chat interface for employees
admin.tsx → Edge case dashboard for managers
/components
ChatWindow.tsx
MessageInput.tsx
MessageBubble.tsx
EdgeCaseList.tsx
/utils
api.ts → API call helpers
aiClient.ts → Query AI / LLM
```
**Details:**
- `ChatWindow`:
- Displays chat messages from knowledge base and edge case answers.
- Auto-scroll and timestamp.
- `MessageInput`:
- Text input for questions.
- Sends question to API route `/api/ask`.
- `EdgeCaseList`:
- Only for managers.
- Shows questions that require attention.
- Allows them to answer and push answer back to knowledge base.
---
## **3. API Routes (Next.js 16+)**
**Suggested routes:**
1. `POST /api/ask`
- Input: `user_id`, `question`
- Process:
- Search knowledge base.
- If found → return answer.
- If not found → create edge case, notify manager.
- Output: `answer` (or status = pending)
2. `POST /api/answer-edge-case`
- Input: `edge_case_id`, `answer`, `manager_id`
- Process:
- Save answer to `answers` table.
- Update `knowledge_base`.
- Notify original user that question is answered.
3. `GET /api/edge-cases`
- For managers to fetch unanswered questions.
---
## **4. Knowledge Base Logic**
- **Simple version:** Use a relational database with `topic` + `content`.
- **Advanced version (later):**
- Embed content as vectors using **OpenAI embeddings** or local vector DB (like **ChromaDB** or **Weaviate**).
- Use semantic search to find the closest matching answer.
- **Edge Case Detection Logic:**
- If similarity score < threshold → classify as edge case.
- Route question to the correct department/manager.
---
## **5. Notification System**
- Could start with **Telegram Bot**:
- Front desk asks a question → API checks KB → no match → create edge case → send Telegram message to manager.
- Manager answers → send Telegram message to front desk → update KB.
**Alternative later:** Slack, email, or SMS.
---
## **6. MVP Workflow**
1. Front desk logs in.
2. Asks a question in chat interface.
3. API checks knowledge base:
- Found → reply immediately.
- Not found → create edge case → notify manager.
4. Manager receives message → answers via admin interface.
5. API ingests answer into knowledge base.
6. Front desk receives the answer → next person asking same question gets immediate answer.
---
## **7. Next.js 16+ Specific Features**
- Use **App Router** for modern Next.js structure (`/app/page.tsx`, `/app/api/ask/route.ts`).
- Server Components for admin dashboard (lightweight SSR for manager view).
- Client Components for chat interface (real-time interaction using **WebSockets** or polling).
- Optional: use **NextAuth.js** for simple authentication for front desk vs manager.
---
## **8. Optional Enhancements**
- **WebSocket Integration:** For real-time chat updates.
- **Message History:** Save all previous Q&A for audit and onboarding.
- **Analytics:** Track edge cases over time → identify gaps in SOP.
- **Multi-org Scaling:** Add `organization_id` to all tables to reuse the app for multiple clients.
---
## **9. First Milestone (Los Portales MVP)**
- Chat interface for front desk.
- Knowledge base search.
- Edge case detection → notify back office manager.
- Manager answer ingestion → updates KB.
- Optional: Telegram or email notification.
**Goal:** Test functionality, refine workflow, collect testimonial.
---
If you want, I can **write the exact Next.js 16+ project scaffold** with **API routes, database schema, and React components** tailored to this workflow so you could start coding immediately.
Do you want me to do that next?
gpt-5-mini