Local vector store RAG demo using TypeScript and LangChain.
ingestcommand to chunk and index source documents in knowledge basechatcommand for interactive Q&A over retrieved context from knowledge base- Azure OpenAI for embeddings and chat
- PostgreSQL +
pgvectorfor retrieval - Chunking, retrieval, and context combination are delegated to LangChain primitives.
- Node.js 22+
- Docker
- Azure OpenAI deployment(s)
- Managed identity (recommended) or API key auth
All runtime settings live in config.yml:
- Azure endpoint, API version, deployment names
- Vector store connection and table names
- Ingest chunking settings
- Chat retrieval settings and system prompt
Only one environment variable is optionally used:
AZURE_OPENAI_API_KEY(only needed when not using managed identity)
npm installdocker compose up -dProvide one or more file paths to ingest:
npm run ingest -- ITM.pdf green-belts-v27.pdf style-guide-for-decisions.pdfnpm run chatThen ask questions in the prompt; type ctrl+d to exit.