Skip to content

Conversation

@Nboss21
Copy link
Collaborator

@Nboss21 Nboss21 commented Jan 23, 2026

Added graphs section of the project

Copilot AI review requested due to automatic review settings January 23, 2026 05:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “graphs” layer for the backend, using LangGraph-based state machines for information upload, vectorization, retrieval, and assistant behavior, and also reworks the backend bootstrap and Prisma data model.

Changes:

  • Adds multiple LangGraph-based agents for file/text ingestion, vector storage, database/RAG retrieval, and an assistant orchestration flow.
  • Expands the Prisma schema to model users, projects, tasks, documents, vector chunks, and associated metadata, and adds a new prisma.config.ts.
  • Replaces the previous Express app/config/middleware setup with a new server.ts, updated TypeScript configuration, and new dependencies/scripts in package.json.

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
backend/tsconfig.json Simplifies TypeScript compiler options and switches to CommonJS/Node resolution for the refactored backend.
backend/src/utils/index.ts Removes previous general-purpose utilities that are no longer used in the new architecture.
backend/src/type.ts Adds a placeholder types file for future shared type definitions (currently empty).
backend/src/server.ts Replaces the previous app bootstrap with a new Express server wiring / and /api and hooking in cookies/CORS/error handling, intended to host the new graph-based features.
backend/src/routes/index.ts Removes the old router that exposed health/API metadata, in favor of the new routing setup.
backend/src/routes.ts Adds a placeholder for the new root routes used by server.ts (currently empty, to be filled with API routes).
backend/src/middlewares/validate.ts Removes the previous generic validation middleware in the move away from the old stack.
backend/src/middlewares/notFound.ts Removes the previous 404 handler as part of the server/middleware refactor.
backend/src/middlewares/errorHandler.ts Removes the old error handler, to be replaced by the new error-handler middleware referenced in server.ts.
backend/src/env.ts Adds an (empty) placeholder for environment/config handling, intended to back the new env import in server.ts.
backend/src/config/index.ts Removes the old configuration helper in favor of a new env/config approach.
backend/src/config/database.ts Removes the old Prisma client/database bootstrap as part of restructuring database access.
backend/src/app.ts Removes the prior Express app entry point in favor of the new server.ts.
backend/src/agents/graphs/vectorGraph.ts Adds a LangGraph workflow for file-based text extraction, chunking, embedding, and vector storage.
backend/src/agents/graphs/textVectorGraph.ts Adds a LangGraph workflow for direct text chunking, embedding, and vector storage without file upload.
backend/src/agents/graphs/textInfoGraph.ts Adds a LangGraph workflow to summarize raw text and persist summary information.
backend/src/agents/graphs/subAssistantRagGraph.ts Adds a LangGraph workflow to embed a query, perform vector search, clean the results, and expose RAG context.
backend/src/agents/graphs/subAssistantDatabaseGraph.ts Adds a LangGraph workflow to fetch and clean project data from the database for the assistant.
backend/src/agents/graphs/informationGraph.ts Adds a LangGraph workflow to summarize uploaded files and save structured summary information.
backend/src/agents/graphs/assistantGraph.ts Adds a top-level assistant workflow that decides whether to use DB/RAG sources and summarizes the combined response.
backend/prisma/schema.prisma Replaces the minimal schema with a full project model (users, projects, tasks, documents, chunks, conflicts, tech stacks, etc.) and a custom Prisma client output path.
backend/prisma.config.ts Introduces a Prisma configuration file tying the schema and migrations to the project’s environment.
backend/package.json Renames the package, updates scripts to use server.ts, and adds dependencies for Prisma, LangGraph, embeddings, and related tooling.
backend/.gitignore Updates gitignore rules to include Prisma artifacts and (intended) generated Prisma client output.
backend/.env.example Removes the old example environment file, to be replaced by env handling via the new configuration approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

prisma/*.db
prisma/*.db-journal

/generated/prisma
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prisma client generator outputs to ../src/generated/prisma, but .gitignore is configured to ignore /generated/prisma, which points at a different directory. As written, the generated Prisma client under src/generated/prisma will not be ignored and is likely to be committed; if the intent is to keep generated code out of version control, the ignore pattern should be updated to match the actual output path (e.g. src/generated/prisma/).

Suggested change
/generated/prisma
src/generated/prisma/

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +24
import express, { Request,Response } from "express";
import cors from "cors"
import routes from "./routes"
import cookieParser from "cookie-parser";
import { errorHandler } from "./middlewares/error-handler";
import { env } from "./env";

const PORT = config.port

app.listen(PORT, () => {
console.log(`🚀 Server is running on http://localhost:${PORT}`)
console.log(`📝 Environment: ${config.nodeEnv}`)
const PORT = env.PORT || 5000
const app = express()
app.use(cors())
app.use(express.json())
app.use(cookieParser());
app.use(errorHandler);

app.get("/",(req:Request,res:Response) => {
res.send("HELLO from Backend!")
})

app.use("/api",routes)

app.listen(PORT,()=>{
console.log(`🚀 server is running on: http://localhost:${PORT}`)
}) No newline at end of file
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions "Added graphs section of the project", but this change set also replaces the server bootstrap (including config and middleware), removes the existing routing/config/database setup, and rewires Prisma configuration. If this broader scope is intentional, it would be helpful to update the PR description to reflect the server/config refactor as well, or otherwise limit the PR to just the new graph agents.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
import { env } from "./env";

const PORT = config.port

app.listen(PORT, () => {
console.log(`🚀 Server is running on http://localhost:${PORT}`)
console.log(`📝 Environment: ${config.nodeEnv}`)
const PORT = env.PORT || 5000
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env is imported and used here, but src/env.ts is currently empty and does not export an env object, so this line will fail to compile (Module './env' has no exported member 'env') and PORT cannot be resolved at runtime. Either implement and export env in env.ts (e.g. wrapping your environment variable config) or change this to read directly from process.env or the appropriate config module.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +14
import { errorHandler } from "./middlewares/error-handler";
import { env } from "./env";

const PORT = config.port

app.listen(PORT, () => {
console.log(`🚀 Server is running on http://localhost:${PORT}`)
console.log(`📝 Environment: ${config.nodeEnv}`)
const PORT = env.PORT || 5000
const app = express()
app.use(cors())
app.use(express.json())
app.use(cookieParser());
app.use(errorHandler);
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errorHandler is imported from ./middlewares/error-handler, but there is no middlewares directory or error-handler module under src, so this import will fail at build time and the error-handling middleware will never be registered. You likely want to restore the previous errorHandler implementation (e.g. from ./middlewares/errorHandler) or add the new middleware file and update the import path to match it.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +5
import { extractText } from "../nodes/informatinUpload/extractText";
import { chunkText } from "../nodes/informatinUpload/chunkText";
import { embedChunks } from "../nodes/informatinUpload/embedChunks";
import { storeChunks } from "../nodes/informatinUpload/storeChunks";
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports reference ../nodes/informatinUpload/*, but there is no nodes directory under src/agents, so all four imported modules (extractText, chunkText, embedChunks, storeChunks) will fail to resolve and this graph cannot compile. Please add the corresponding nodes/informatinUpload implementation files or update the import paths to the correct locations (the repeated informatinUpload spelling also looks unintentional).

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +5
import { embedGeneratedQuery } from "../nodes/InformationRetrieve.ts/embedQuery";
import { searchEmbeddedData } from "../nodes/InformationRetrieve.ts/vectorSearch";
import { cleanVectorSearchInfo } from "../nodes/InformationRetrieve.ts/cleanVectorSearchInfo";
import { SSEEmit } from "../../utils/sse";
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

embedGeneratedQuery, searchEmbeddedData, cleanVectorSearchInfo, and SSEEmit are imported from ../nodes/InformationRetrieve.ts/* and ../../utils/sse, but neither a nodes nor a utils directory exists under src, so these imports will all fail and subAssistantRAG_Agent cannot be built. You’ll need to add the corresponding node/SSE implementations or correct these import paths to valid modules.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +4
import { getProjectData } from "../tools/databaseAccess";
import { cleanDatabaseInfo } from "../nodes/InformationRetrieve.ts/cleanDatabaseInfo";
import { SSEEmit } from "../../utils/sse";
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getProjectData, cleanDatabaseInfo, and SSEEmit are imported from ../tools/databaseAccess, ../nodes/InformationRetrieve.ts/cleanDatabaseInfo, and ../../utils/sse, but there is no tools, nodes, or utils directory under src, so these imports will all fail at build time. Please add the missing modules (e.g. agents/tools/databaseAccess.ts, agents/nodes/InformationRetrieve.ts/cleanDatabaseInfo.ts, and utils/sse.ts) or update the paths to the actual implementations.

Copilot uses AI. Check for mistakes.
res.send("HELLO from Backend!")
})

app.use("/api",routes)
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

routes is imported from ./routes, but src/routes.ts is currently an empty file, so routes will be undefined and app.use("/api", routes) will throw at runtime (Express expects a middleware function or router, not undefined). Either implement and export an Express router from routes.ts or adjust the import to point at the correct routes module.

Suggested change
app.use("/api",routes)
if (routes) {
app.use("/api", routes);
}

Copilot uses AI. Check for mistakes.
"scripts": {
"dev": "tsx watch src/server.ts",
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon src/server.ts",
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dev script runs nodemon src/server.ts, but nodemon by itself cannot execute TypeScript files, so npm run dev will try to run raw .ts in Node and fail (e.g. with Cannot use import statement outside a module). Consider using ts-node/ts-node-dev (which you already depend on) via nodemon --exec ts-node src/server.ts or replacing nodemon with ts-node-dev in this script.

Suggested change
"dev": "nodemon src/server.ts",
"dev": "nodemon --exec ts-node src/server.ts",

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +4
import { findInformationSource } from "../nodes/InformationRetrieve.ts/decideInformationSource";
import { summarizeResponse } from "../nodes/InformationRetrieve.ts/responseSummary";
import { SSEEmit } from "../../utils/sse";
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports reference ../nodes/InformationRetrieve.ts/* and ../../utils/sse, but there is no nodes or utils directory under src, so findInformationSource, summarizeResponse, and SSEEmit will all fail to resolve and this graph will not compile. Please add the missing nodes/InformationRetrieve.ts and utils/sse modules or update the import paths to where those helpers actually live.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants