Hemlis Vector Database Documentation

Hemlis is a high-performance vector database engineered for blazing-fast similarity search. This documentation will help you get started quickly and integrate Hemlis into your applications.

Quick Start

Installation

Hemlis is provided as a subscription service with Docker deployment. After subscribing, you'll receive access credentials and deployment instructions.

🚀 What You Get

Docker Deployment

# Pull the Hemlis container (requires subscription)
docker pull hemlis/vectordb:latest

# Run with basic configuration
docker run -d \
  --name hemlis-db \
  -p 8080:8080 \
  -e HEMLIS_API_KEY=your-api-key \
  -e HEMLIS_CONFIG=production \
  hemlis/vectordb:latest

# Verify the service is running
curl http://localhost:8080/health

API Reference

Authentication

All API requests require authentication via API key in the header:

Authorization: Bearer your-api-key

Core Endpoints

Insert Vectors

POST /vectors
Content-Type: application/json

{
  "vectors": [
    {
      "id": "doc1",
      "values": [0.1, 0.2, 0.3, ...],
      "metadata": {"category": "tech", "title": "Document 1"}
    },
    {
      "id": "doc2", 
      "values": [0.4, 0.5, 0.6, ...],
      "metadata": {"category": "science", "title": "Document 2"}
    }
  ]
}

Search Similar Vectors

POST /search
Content-Type: application/json

{
  "vector": [0.1, 0.2, 0.3, ...],
  "k": 10,
  "filter": {
    "category": "tech"
  },
  "threshold": 0.8
}

Response Format

{
  "results": [
    {
      "id": "doc1",
      "score": 0.95,
      "metadata": {"category": "tech", "title": "Document 1"}
    }
  ],
  "took": "2ms",
  "total": 1
}

Integration Examples

Python with LangChain

from langchain.vectorstores import Hemlis
from langchain.embeddings import OpenAIEmbeddings

# Initialize Hemlis vector store
vectorstore = Hemlis(
    endpoint="http://localhost:8080",
    api_key="your-api-key",
    embedding_function=OpenAIEmbeddings()
)

# Add documents
documents = ["Document 1", "Document 2", "Document 3"]
vectorstore.add_texts(documents)

# Search similar documents
results = vectorstore.similarity_search("query text", k=5)

JavaScript/Node.js

const HemlisSdk = require('@hemlis/sdk');

const client = new HemlisSdk({
  endpoint: 'http://localhost:8080',
  apiKey: 'your-api-key'
});

// Insert vectors
await client.insert({
  vectors: [
    { id: 'doc1', values: [0.1, 0.2, 0.3] },
    { id: 'doc2', values: [0.4, 0.5, 0.6] }
  ]
});

// Search
const results = await client.search({
  vector: [0.1, 0.2, 0.3],
  k: 10
});

cURL Examples

# Health check
curl -H "Authorization: Bearer your-api-key" \
  http://localhost:8080/health

# Insert vectors
curl -X POST \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"vectors":[{"id":"test","values":[0.1,0.2,0.3]}]}' \
  http://localhost:8080/vectors

# Search vectors  
curl -X POST \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"vector":[0.1,0.2,0.3],"k":5}' \
  http://localhost:8080/search

Performance Features

⚡ Key Performance Advantages

Configuration Options

Environment Variables

Production Deployment

# Production-ready Docker Compose
version: '3.8'
services:
  hemlis:
    image: hemlis/vectordb:latest
    ports:
      - "8080:8080"
    environment:
      - HEMLIS_API_KEY=your-production-key
      - HEMLIS_CONFIG=production
      - HEMLIS_LOG_LEVEL=info
    volumes:
      - hemlis-data:/var/lib/hemlis
    restart: unless-stopped
    
volumes:
  hemlis-data:

Support & Resources

📞 Get Help

Common Use Cases

Best Practices