Skip to content

django205/ai-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot with Memory & Context (RAG)

This project demonstrates a production-ready chatbot backend using:

  • Node.js + TypeScript
  • MongoDB (conversation + long-term memory)
  • MongoDB Atlas Vector Search (semantic memory)
  • OpenAI LLM

Features

  • Conversational memory
  • Semantic recall using vector search
  • Long-term fact extraction
  • Clean architecture (API / Application / Domain / Infra)
  • Easily extensible for agents, tools, RBAC

MongoDB Vector Index Setup

Before running, create the memory_index on your memories collection with the following mapping:

{
  "fields": [
    {
      "numDimensions": 768,
      "path": "embedding",
      "similarity": "cosine",
      "type": "vector"
    },
    {
      "path": "userId",
      "type": "filter"
    },
    {
      "path": "importance",
      "type": "filter"
    }
  ]
}

Refer to MongoDB Atlas documentation for details on creating vector indexes.

Run

npm install
cp .env.example .env
npm run dev

API

POST /chat

{
  "userId": "user1",
  "message": "My name is Yogesh"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors