Prerequisites
1
Create a Project
Create a project and generate an API key in the LiquidIndex dashboard (requires card on file).
2
Install Dependencies
3
Set Environment Variables
Create a
.env
file in your project root:.env
Build Your RAG Backend
This guide shows you how to build a Multi-Tenant system. You’ll create three simple endpoints that handle the complete RAG workflow: customer creation, file uploads, and semantic search.1. Create a Customer
Create an endpoint to register new customers in your system. Each customer gets their own isolated data space.lqx.js
2. Create an Upload Session
Generate a secure upload URL where your customers can upload their documents. LiquidIndex handles all the file processing and indexing automatically.lqx.js
3. Query Customer Data
Perform semantic search across a customer’s uploaded documents. Get relevant chunks and AI-generated answers in one API call.lqx.js
Complete Working Example
Copy and paste this complete server code to get started immediately. This gives you a fully functional RAG backend in under 50 lines of code:app.js
Test Your Implementation
1
Start Your Server
2
Create a Customer
3
Create Upload Session
4
Query the Data
What’s Next?
- Production Ready: Add authentication, error handling, and rate limiting
- Single Tenant: Need a simpler setup? Check out Single-Tenant Sessions
- Advanced Features: Explore Subpages and Internet Search
- Concepts: Learn more about Multi-Tenant Architecture