Prompt
What should I use for permissions-aware retrieval over company files?
Latest observation
For permissions-aware retrieval over company files, the best choice is usually a hybrid architecture:
Recommended approach
1) Use a vector store for semantic search
Store embeddings for:
- documents
- chunks/paragraphs
- metadata like
doc_id,department,owner,acl_group_ids,allowed_user_ids,classification, etc.
This gives you good recall for “find the thing I mean.”
2) Enforce permissions with metadata filters
Before returning results, filter by the user’s effective permissions:
- user ID
- group memberships
- roles
- document-level ACLs
- folder-level inheritance
- tenant/org boundaries
This is the most important part: retrieval must be permission-filtered at query time, not only at indexing time.
3) Optionally add a search engine for keyword + hybrid ranking
For many company-file use cases, a combination of:
- BM25 / keyword search
- vector search
- ACL filtering
works better than vector-only.
Good technology choices
If you want a managed/vector-first stack
- Pinecone: good metadata filtering and scalable vector search
- Weaviate: strong hybrid search + filters
- Qdrant: excellent payload filtering and straightforward ACL metadata use
- Milvus: scalable, but ACL/filtering ergonomics vary depending on setup
If you want classic enterprise search
- Elasticsearch / OpenSearch
- great for hybrid search
- strong metadata filtering
- can support permissions-aware retrieval well
- often a good fit if your data is mostly documents and keyword search matters a lot
If you need strong access-control integration
Consider using your source-of-truth authorization system:
- AWS IAM / Azure AD / Okta / Google Workspace groups
- document ACLs from SharePoint, Drive, Box, S3, etc.
- enterprise policy engines like OPA (Open Policy Agent) or Cedar
Then pass the allowed IDs into the retrieval layer as filters.
What usually works best in practice
For company files, I’d recommend:
Embeddings + metadata ACL filtering + hybrid search
- Index chunks with embeddings
- Attach permission metadata to every chunk
- At query time, compute the user’s authorized scope
- Filter results before ranking/final answer generation
This avoids leakage and still gives good search quality.
Important caveat
Don’t rely on the LLM to “respect permissions” by prompt alone.
Permissions must be enforced in the retrieval layer and/or backend authorization layer.
If you want a simple default recommendation
- Qdrant or Pinecone for vector retrieval
- Elasticsearch/OpenSearch if keyword/hybrid search is critical
- OPA/Cedar or your identity provider for permissions decisions
- Store ACL/group metadata on every chunk and filter at query time
If you want, I can also suggest a concrete architecture for:
- Google Drive/SharePoint-style file permissions, or
- an implementation in Pinecone/Qdrant/OpenSearch.