Summary
Allow users to add and remove multiple documentation sources in a single chat for both vector and vectorless modes.
Problem
Current chat creation is centered around one docsUrl. While chat-to-source relation exists, the creation and querying flow effectively assumes a single primary source. There is no full user flow to add/remove sources after chat creation.
Expected Solution
Implement multi-source management in chat creation pop-up in dashboard and inside chat page. A chat should be able to attach many ChatSource rows. Reuse existing ChatSource for matching URL + mode when already ingested. Removing a source from a chat must detach it from the chat only, not delete shared source/index data. For one chat source use one qdrant collection (vector) or tree id (vectorless) and reuse across chats/users.
Scope
- Backend:
backend/controllers/chat.controller.js
backend/controllers/chatMessage.controller.js
backend/routers/chat.route.js
backend/prisma/schema.prisma + migration(s)
backend/chatWorker.js
- Frontend:
src/pages/Dashboard.tsx (create modal input model)
src/pages/ChatPage.tsx (add/remove sources UI)
src/lib/api.ts
Acceptance Criteria
Notes
Treat source identity as (normalizedUrl, isVectorLess) to avoid duplicate ingestion.
Summary
Allow users to add and remove multiple documentation sources in a single chat for both vector and vectorless modes.
Problem
Current chat creation is centered around one
docsUrl. While chat-to-source relation exists, the creation and querying flow effectively assumes a single primary source. There is no full user flow to add/remove sources after chat creation.Expected Solution
Implement multi-source management in chat creation pop-up in dashboard and inside chat page. A chat should be able to attach many
ChatSourcerows. Reuse existingChatSourcefor matching URL + mode when already ingested. Removing a source from a chat must detach it from the chat only, not delete shared source/index data. For one chat source use one qdrant collection (vector) or tree id (vectorless) and reuse across chats/users.Scope
backend/controllers/chat.controller.jsbackend/controllers/chatMessage.controller.jsbackend/routers/chat.route.jsbackend/prisma/schema.prisma+ migration(s)backend/chatWorker.jssrc/pages/Dashboard.tsx(create modal input model)src/pages/ChatPage.tsx(add/remove sources UI)src/lib/api.tsAcceptance Criteria
ChatSourcemaps to exactly one index identity (Qdrant collection for vector, tree id for vectorless).Notes
Treat source identity as
(normalizedUrl, isVectorLess)to avoid duplicate ingestion.