A sophisticated RAG (Retrieval-Augmented Generation) application built with TypeScript, Express.js, and LangChain. This application allows users to process PDF documents and perform intelligent question-answering using advanced language models.
- 📄 PDF Document Processing
- 🔍 Intelligent Document Search
- 💡 Question-Answering System
- 🚀 Built with LangChain and TypeScript
- 🔒 Secure API Endpoints
- 🎯 Efficient Document Chunking and Embedding
- Node.js (v16 or higher)
- TypeScript
- Ollama (for local embeddings)
- HuggingFace API key (for language model access)
- Clone the repository:
git clone https://github.com/yourusername/psy-rag-app.git
cd psy-rag-app- Install dependencies:
npm install- Create a
.envfile in the root directory and add your configuration:
HUGGINGFACE_API_KEY=your_api_key_here
PORT=3000For development:
npm run devThe server will start on the configured port (default: 3000).
src/
├── app.ts # Express application setup
├── server.ts # Server initialization
├── helper.ts # Utility functions
├── data/ # PDF storage directory
└── services/
├── rag.service.ts # RAG implementation
└── ai.service.ts # AI model integration
POST /upload- Upload PDF documentsPOST /query- Query the documents with questions
- TypeScript
- Express.js
- LangChain
- HuggingFace
- Ollama
- PDF-Parse
ISC
Contributions are welcome! Please feel free to submit a Pull Request.