Skip to content
Courses/Advanced and secure RAG/Qdrant Multi-User and Permissions

Qdrant Multi-User and Permissions

The most dangerous failure in multi-user RAG isn't answering incorrectly: it's retrieving the right document for the wrong person. Permissions must be enforced before sending context to the model.

  • Design payloads to isolate clients, users, and documents.
  • Apply filters before retrieving chunks.
  • Avoid one collection per client when it's not necessary.

Minimum Payload

Terminal
{
  "tenant_id": "client_acme",
  "workspace_id": "legal",
  "document_id": "contract-001",
  "page": 12,
  "visibility": "internal",
  "allowed_roles": ["admin", "legal"],
  "source": "contracts/contract-001.pdf"
}

Filter Before Search

Terminal
from qdrant_client import QdrantClient, models

client = QdrantClient("http://localhost:6333")

filtro = models.Filter(
    must=[
        models.FieldCondition(
            key="tenant_id",
            match=models.MatchValue(value="client_acme"),
        ),
        models.FieldCondition(
            key="allowed_roles",
            match=models.MatchAny(any=["legal"]),
        ),
    ]
)

resultados = client.query_points(
    collection_name="documentos",
    query=[0.01, 0.02, 0.03],
    query_filter=filtro,
    limit=5,
)

Leak Test

Terminal
Case:
- User A belongs to client_acme
- User B belongs to client_beta
- Both ask a similar question

Test:
1. Index documents with different tenant_id values.
2. Ask as User A.
3. Verify that no chunk from client_beta appears in the trace.
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue