Conversation
fbb46b6 to
ec08d73
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a LangChain-based chatbot streaming endpoint with MCP tooling support, plus a PGVector-backed “vector store” ingestion/admin UI for uploading/searching PDF content, along with related runtime config, k8s env wiring, and i18n additions.
Changes:
- Add LangChain + LangGraph streaming chat route and integrate MCP tools / vector retriever tool.
- Add PGVector store initialization utility plus secured server routes to ingest/list/get/delete vectorized documents.
- Add Admin UI tab/components to manage vector-store documents and extend locales/configuration.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds LangChain, pg, uuid, and related transitive deps. |
| package.json | Adds LangChain/PG/vector-store dependencies (and an extra unused dep). |
| nuxt.config.ts | Adds runtimeConfig keys for LangChain + vector DB (but includes a breaking typo). |
| k8s/projects-frontend/values.yaml | Adds Helm env vars for LangChain + vector DB config. |
| k8s/projects-frontend/values.dev.yaml | Adds dev Helm env vars for LangChain + vector DB config. |
| .env.sample | Documents new LangChain/vector DB env vars and fixes minor whitespace. |
| .zed/debug.json | Adds Zed debug config for attaching to Nuxt. |
| src/server/routes/api/chat-lg-stream.ts | New LangChain streaming endpoint with MCP + vector retriever tool. |
| src/server/utils/vector-db.js | New PGVectorStore + pg Pool initialization helper. |
| src/server/utils/check-vector-db-rights.js | New authz helper to restrict vector-store endpoints to superusers. |
| src/server/routes/api/vector-store/list.get.ts | New endpoint to list ingested docs by title/chunk count. |
| src/server/routes/api/vector-store/get.get.ts | New endpoint to fetch chunks for a given title. |
| src/server/routes/api/vector-store/ingest.post.ts | New endpoint to ingest a PDF into the vector store. |
| src/server/routes/api/vector-store/delete.delete.ts | New endpoint to delete vectors by title/orgCode. |
| src/server/routes/mcp/index.ts | Adds extra MCP tracing logs (includes a typo). |
| src/pages/AdminPortalPageV2/AdminPortalPage.vue | Adds a “Vector store” tab for super admins. |
| src/app/useAdminPagesRoutes.ts | Adds a new admin route for the vector-store tab. |
| src/pages/AdminPortalPageV2/Tabs/VectorStoreAdminTab.vue | New admin tab UI for listing/adding/editing/deleting documents. |
| src/components/VectorStoreDocumentList.vue | New component to list vector-store documents. |
| src/components/VectorStoreDocumentShow.vue | New component to display document chunks. |
| src/components/VectorStoreIngestionForm.vue | New drawer form to upload/ingest documents. |
| src/components/app/ChatBotDrawer.vue | Adds profile/page-context injection toggles for chatbot prompt context. |
| src/app/useProjectPagesRoutes.ts | Adds route meta used as chatbot context on project pages. |
| src/mcp-server/projects/base.ts | Imports orgCode for tool query usage (context for project-tool change). |
| src/mcp-server/projects/project-tool.ts | Adjusts “similar projects” tool request/query mapping logic. |
| src/mcp-server/projects/sdg-tool.ts | Replaces hardcoded SDGs with src/data/sdgs.json. |
| src/data/sdgs.json | Adds SDG titles/descriptions alongside colors. |
| src/components/people/UserProfile/UserProjectsSearch.vue | Adds null-guard to avoid errors on empty responses. |
| src/i18n/locales/en.json | Adds vector-store strings + new chatbot permission strings (typos + duplicate key). |
| src/i18n/locales/fr.json | Adds vector-store strings + new chatbot permission strings. |
| src/i18n/locales/de.json | Adds vector-store strings + new chatbot permission strings. |
| src/i18n/locales/es.json | Adds vector-store strings + new chatbot permission strings. |
| src/i18n/locales/ca.json | Adds vector-store strings + new chatbot permission strings. |
| src/i18n/locales/nl.json | Adds vector-store strings + new chatbot permission strings. |
| src/i18n/locales/et.json | Adds vector-store strings + new chatbot permission strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
appOpeyanaApiPromptVersion to appOpenaApiPromptVersion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 34 changed files in this pull request and generated 15 comments.
Comments suppressed due to low confidence (2)
src/mcp-server/projects/project-tool.ts:288
- In
project-similar,resultsis initialized as{}but the output schema declaresresultsas an array. If the fetch fails, the tool will return{ results: {} }, violating the schema and potentially breaking clients. Initializeresultsas[](and keep it an array on error paths).
async ({ idOrSlug }, extras) => {
let results = {}
try {
const queryResult: any = await mcpFetch(
// TODO: use org code from config
`${API_BASE_URL}project/${idOrSlug}/similar/`,
{
query: {
organizations: orgCode,
},
},
extras
)
console.log('queryResult', queryResult)
results = queryResult.map((p: any) => mapProjectPreview(p))
} catch (error) {
console.error('Error fetching project similar projects:', error)
}
const output = { results }
src/mcp-server/projects/project-tool.ts:290
- This adds
console.log('queryResult', queryResult)(and later logs the tool call output). These logs can be very noisy and may include user/project data. Consider removing them or routing through the existingtraceMcpmechanism so they can be enabled/disabled via config.
console.log('queryResult', queryResult)
results = queryResult.map((p: any) => mapProjectPreview(p))
} catch (error) {
console.error('Error fetching project similar projects:', error)
}
const output = { results }
console.log('MCP TOOL CALLED: project-similar-projects', { idOrSlug, output })
return {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 34 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.