https://github.com/permitio/permit-langflow
A Permit.io and Langflow example app.
https://github.com/permitio/permit-langflow
example
Last synced: 9 months ago
JSON representation
A Permit.io and Langflow example app.
- Host: GitHub
- URL: https://github.com/permitio/permit-langflow
- Owner: permitio
- License: apache-2.0
- Created: 2024-10-23T14:11:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-09T11:09:03.000Z (about 1 year ago)
- Last Synced: 2025-05-11T07:11:32.170Z (9 months ago)
- Topics: example
- Language: Python
- Homepage:
- Size: 1.1 MB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# permit-langflow
## AstraDB instructions:
1. Create a database
2. Create Vector-enabled collection with Mistral Embeddings
3. Leave the collection empty
## Permit.io instructions:
1. Resources with resource roles

2. Resource relations



3. Role derivation relations



4. Policy

5. Users

6. Instances

## LangFlow instructions:
1. Create a new blank project
2. Create a confidential Global Variable in Settings for Permit Key

3. Import `flows.json` into LangFlow
- you should be ok with importing this JSON only
- other `*.py` files are added for reference as they are custom components implemented for this project
4. Add Mistral API key
1. Create a free Mistral account
2. Get your API key from https://console.mistral.ai/api-keys/
3. Add the key to Mistral components
5. Run ingestion flow:
1. Select the AstraDB database and collection
2. Click Play button
3. Check if the collection is populated with vectors
6. Install Permit with `pip install` component
- make sure the installation succeeds by verifing output `Installation status`
7. Run the Permit Policy Decision Point (PDP) locally:
```bash
docker run -p 7766:7000 --env PDP_API_KEY= --env PDP_DEBUG=true permitio/pdp-v2:latest
```
8. Use `ngrok` to create a tunnel from `http://localhost:7766` to an external endpoint provided by `ngrok`:
```bash
ngrok http http://localhost:7766
```
9. Run the chat flow by either:
1. Opening the Playground (bottom right corner)
2. Clicking the Play icon button on the **last** component
10. Example queries:

