This Node.js project demonstrates how to embed and index documents into Qdrant Cloud using local embeddings and the Qdrant REST client. Ideal for building AI-powered search, recommendation systems, or RAG pipelines.
- Node.js
- Qdrant Cloud
- @xenova/transformers – Local embedding pipeline
- dotenv – For environment variable management
git clone https://github.com/matheussf/qdrant.git
cd qdrant
npm installCreate a .env file in the root of the qdrant/ directory:
QDRANT_URL=https://your-cluster-name.cloud.qdrant.io
QDRANT_API_KEY=your_qdrant_api_key
🔐 You can find both in your Qdrant Cloud dashboard.
qdrant/
├── index.js # Main script: loads model, embeds & indexes docs
├── documents.json # List of example documents
├── .env # Your Qdrant credentials
├── package.json # Project metadata and dependencies
└── README.md # You're here!
The documents.json file should look like:
[
{
"id": "doc1",
"title": "First Document",
"text": "This is the content of the first document about AI."
}
]node index.jsThis will:
- Load the local embedding model (
all-MiniLM-L6-v2) - Embed all documents
- Push them to your Qdrant Cloud collection
- The embedding model runs locally via @xenova/transformers, no Python needed.
- Be sure your
QDRANT_API_KEYhas write access to the collection.