Team Y

Kamil Janeczek
June 18, 2024
AI assistant
Backend
GenAI JavaScript
LLM
RAG

Objective

Create personal AI powered assistant that can help with day to day task improve my performance

Technologies

Fastify
Node.js
JavaScript
TypeScript
OAuth2
Google API
Prisma
Zod
langachain
Vecel- /blob
Vercel- /kv
puppeteer

Social share

Challenge

Team Y application is a backend for AI assistant. It is fronted agnostic with user experiance in mind, only just a few of endpoint when interacting with assistant. Main features supported:

  • session management
  • security
  • conversation with bot
  • storage of conversations
  • long and short term memory
  • integration with Google service (calendar, tasks, gmail)
  • advanced RAG techniques see more in this post
  • ingestion of documents
  • voice transcrition

This application is built using TypeScript. It uses Node.js for runtime. The application uses Fastify, a fast and low overhead web framework for Node.js, for handling HTTP requests. The application uses Prisma, an open-source database toolkit, for database operations, dotenv for managing environment variables. Vercel/blob is used for file storage and Vercel/kv for Redis like database.

Here is a specyfication of API:

  1. User
  • /register POST
  • /session POST
  • /login POST
  • /logout POST
  1. Conversation
  • /ask POST
  • /snippets GET
  1. Action
  • /transcribe POST
  • /transcribeAndAsk POST
  • /uploadfile
  • /uploadrecording
  1. Chat
  • /create POST
  • /:chatId GET
  • /getchats/:botId GET
Login
User needs to login to gain access to application. In response service returns auth token that needs to be attached to each and every requsest to the server. For browsers, token is automatically saved to cookies. If needed new account can be created.
Team Y app - project structure
Create chat
After sucessful login user choose we creat a chat in order to take advanatage of conversational capabilities of bot
Team Y app - Create chat
Conversation with assistant
Using context of chat we send messages towards bot. API is simple and unified. One main endpoint /ask to communicate with bot.
Team X app - Conversation with assistant

Releated Projects