← all repositories
Azure-Samples/serverless-chat-langchainjs

Serverless RAG chat that runs locally before you pay Azure

This sample wires LangChain.js, Azure Functions, and Cosmos DB into a serverless RAG chatbot you can run locally with Ollama before touching Azure.

serverless-chat-langchainjs
Not currently ranked — collecting fresh signals.
star history

What it does This is a full-stack sample application that lets a chatbot answer questions from a set of enterprise documents using Retrieval-Augmented Generation. The frontend is a single web component built with Lit and hosted on Azure Static Web Apps; the backend is an Azure Functions API that uses LangChain.js to ingest documents, generate embeddings, and retrieve context from Azure Cosmos DB for NoSQL. Source documents are stored in Azure Blob Storage, and the whole conversation follows the HTTP protocol for AI chat apps.

The interesting bit Most cloud samples force you to provision resources before you know if the architecture fits; this one lets you run the full RAG pipeline locally using Ollama and Llama 3.1, vector search included, so you can validate the stack before spending Azure credits. It is fundamentally glue code connecting Azure services, but the local-dev escape hatch makes it more useful than most vendor samples.

Key highlights

  • Fully serverless on Azure: Static Web Apps, Functions, Cosmos DB, and Blob Storage.
  • Uses Azure Cosmos DB for NoSQL as the vector database for document retrieval.
  • Persists per-user chat session history.
  • Supports local, offline development via Ollama with no cloud costs.
  • Implements the standard HTTP protocol for AI chat apps between frontend and API.

Caveats

  • Cloud deployment requires elevated Azure permissions—RBAC Administrator, User Access Administrator, or Owner—and an OpenAI-enabled subscription, so it is not a frictionless sandbox.
  • It is explicitly a sample/template, which means you are expected to treat it as starter wiring rather than a finished product.

Verdict Grab it if you are a TypeScript developer exploring serverless RAG on Azure and want a working reference to crib from. Pass if you need a cloud-agnostic framework or a battle-hardened production system.

Frequently asked

What is Azure-Samples/serverless-chat-langchainjs?
This sample wires LangChain.js, Azure Functions, and Cosmos DB into a serverless RAG chatbot you can run locally with Ollama before touching Azure.
Is serverless-chat-langchainjs open source?
Yes — Azure-Samples/serverless-chat-langchainjs is open source, released under the MIT license.
What language is serverless-chat-langchainjs written in?
Azure-Samples/serverless-chat-langchainjs is primarily written in TypeScript.
How popular is serverless-chat-langchainjs?
Azure-Samples/serverless-chat-langchainjs has 858 stars on GitHub.
Where can I find serverless-chat-langchainjs?
Azure-Samples/serverless-chat-langchainjs is on GitHub at https://github.com/Azure-Samples/serverless-chat-langchainjs.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.