Skip to content

refactor(agentic-rag): Use langchain-spicedb SpiceDBAuthorizer for authorization#45

Merged
sohanmaheshwar merged 2 commits into
mainfrom
new_langchain_library
May 20, 2026
Merged

refactor(agentic-rag): Use langchain-spicedb SpiceDBAuthorizer for authorization#45
sohanmaheshwar merged 2 commits into
mainfrom
new_langchain_library

Conversation

@sohanmaheshwar
Copy link
Copy Markdown
Contributor

Summary

  • Replaces hand-rolled authorization_helpers.py (manual CheckBulkPermissions gRPC) with langchain-spicedb's SpiceDBAuthorizer.filter_documents
  • Simplifies grpc_helpers.py to use authzed's built-in InsecureClient instead of manual channel construction
  • Adds langchain-spicedb (from GitHub, pending PyPI release) to requirements.txt
  • Updates test_improvements.py to reflect the new imports and removed helpers

Test Plan

  • Start SpiceDB locally (docker run -p 50051:50051 authzed/spicedb serve --grpc-no-tls --grpc-preshared-key devtoken)
  • Start Weaviate locally
  • pip install -r requirements.txt and start the FastAPI server
  • Make a query via the UI and confirm authorization filtering works
  • Run python test_improvements.py and verify all checks pass

…orizer

Switches the authorization node from manual CheckBulkPermissions gRPC calls
to the langchain-spicedb library's SpiceDBAuthorizer.filter_documents, removing
the hand-rolled authorization_helpers.py and simplifying grpc_helpers.py to use
authzed's built-in InsecureClient.
Copy link
Copy Markdown
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sohanmaheshwar sohanmaheshwar merged commit 9dbe7fb into main May 20, 2026
7 checks passed
@sohanmaheshwar sohanmaheshwar deleted the new_langchain_library branch May 20, 2026 14:28
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants