KomaSattarov
KomaSattarov13mo ago

Langchain + Convex, please...

Hey there beautiful people at convex.dev! I am thinking of implementing an AI functionality to my nextjs typescript app. The convex schema looks like this:
export default defineSchema({ documents: defineTable({ title: v.string(), userId: v.string(), content: v.optional(v.string()), category: v.optional(v.string()), isChecked: v.optional(v.boolean()), trScore: v.optional(v.number()), //Task Response Score ccScore: v.optional(v.number()), //Coherence & cohesion Score lrScore: v.optional(v.number()), //Lexical Resources Score grScore: v.optional(v.number()), //Grammar Range & accuracy Score overallScore: v.optional(v.number()), trScoreFeedback: v.optional(v.string()), ccScoreFeedback: v.optional(v.string()), lrScoreFeedback: v.optional(v.string()), grScoreFeedback: v.optional(v.string()), overallScoreFeedback: v.optional(v.string()), }).index("by_user", ["userId"]), });
I ve already set up an api call to OpenAI to assess the user's written work, create scores and feedback for each scoring criteria, and store those scores. However, I now, want to create a context aware chat functionality that already knows the document's content, the assessment scores, and the feedback for each score. The main idea of this chat function is to allow users to ask questions related to ONLY this document. For example, user may ask "Why my Task Response score was low, and how could I improve it?", and the AI should create a response based on its knowledge of document content, task response score and feedback. I don't know how to do it. Please, guide me, show me the way... I am new to coding, so, detailed guidence would be highly appreciated. Thank you very much!
3 Replies
Michal Srb
Michal Srb12mo ago
Build AI Chat with Convex Vector Search
Convex is a full-stack development platform and cloud database, including built-in vector search. In this third post in our [series](https://stack.con...
How I built NotesGPT – a full-stack AI voice note taking app
I recently built a full-stack app called notesGPT. It allows you to record a voice note, transcribes it, and extract action items and display them as ...
Templates
The backend application platform with everything you need to build your product.
KomaSattarov
KomaSattarovOP12mo ago
Thanks for the response. However, can you help me break down what needs to be done, like step-by-step, please. I am very new to coding, thus, I do not possess experience or in-depth understanding of programming... I checked out the links you've shared, but they seem a bit confusing and a bit different to what I am trying to build.
Michal Srb
Michal Srb12mo ago
Hey @KomaSattarov, I don't think I can explain it better than in the article I wrote. Maybe clone the repo and play with it. Another resource that could help is this workshop: https://labs.convex.dev/ai
Convex AI Workshop
Learn how to build AI apps with Convex

Did you find this page helpful?