[Integration]: NeedToKnow — permission-aware retrieval (AccessFilter)

Đang mở
#773 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 13 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
54/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Start with the published needtoknow-haystack repository and its AccessFilter component; the issue also names examples/leak_benchmark.py and the unit and pipeline tests. Check how the component filters documents by user, groups, and public metadata, then run the tests and benchmark. Done means the integration is listed with its repository, description, and evidence of working behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Stage

Ready: integration exists and works, proposing to list it

Integration or project name

needtoknow-haystack

Integration type

Custom Component

Published package or repo (if it exists)

https://github.com/Sanoer11/needtoknow-haystack

Need or proof of use

Why Haystack users need it: most RAG pipelines retrieve from one shared index, and retrieval ranks by relevance, not by who is asking. Whatever the retriever returns reaches the prompt, so one user can get another team's restricted documents. LangChain (Permit, Auth0 FGA retrievers) and LlamaIndex (Auth0 FGA) have permission-aware retrieval; I couldn't find a store-agnostic equivalent among the listed Haystack integrations.

Proof it works:

  • Leak benchmark (examples/leak_benchmark.py, offline, synthetic company corpus, 5 users x 10 probing queries, BM25 top-5): 58% of retrieved documents leaked across departments without the filter, 0% with AccessFilter.
  • 22 unit and pipeline tests, including YAML pipeline serialization round-trips.
  • CI on every push: Python 3.10 and 3.13 x Haystack 2.31 and 3.x (all green).

It grew out of NeedToKnow (https://github.com/Sanoer11/needtoknow), my permission-aware RAG project, where the same per-user filtering took cross-user leakage from 43.2% to 0% on 250 adversarial probe results. It doesn't have external users yet; I'm happy to publish it to PyPI if that's preferred before listing.

Short description

AccessFilter is a component that sits after any Haystack retriever and removes documents the requesting user may not read. Each document declares access in its metadata (allowed_users, allowed_groups, or an optional public flag), and the filter keeps a document only if the user, one of their groups, or the public flag matches.

It fails closed: documents without access metadata are denied by default, and an empty user_id raises an error. It works with any document store, returns denied_count for auditing, supports top_k after filtering, and serializes with pipelines (in Haystack 3, via allowed_modules=["needtoknow_haystack"]).

Ngôn ngữ chính
Python
Star
114
Fork
324
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của deepset-ai/haystack-integrations

Tất cả issue của deepset-ai/haystack-integrations

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.