You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agentic-rag-authorization/README.md
+40-19Lines changed: 40 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,26 +92,19 @@ The agent transparently explains access limitations instead of failing silently.
92
92
### Steps
93
93
94
94
```bash
95
-
# 1. Start services
95
+
# 1. Configure
96
+
cp .env.example .env
97
+
# Edit .env with your actual OpenAI API key
98
+
99
+
# 2. Start services
96
100
docker-compose up -d
97
101
98
-
#2. Install dependencies
102
+
#3. Install dependencies
99
103
python3 -m venv venv
100
104
source venv/bin/activate
101
105
pip install -r requirements.txt
102
-
103
-
# 3. Configure
104
-
cp .env.example .env
105
-
# Edit .env with your actual OpenAI API key (never commit .env!)
106
-
107
-
# 4. Initialize data
108
-
python3 examples/setup_environment.py
109
-
110
-
# 5. Run demo
111
-
python3 examples/basic_example.py
112
106
```
113
107
114
-
115
108
## Web UI
116
109
117
110
A web interface is available to demonstrate the authorization capabilities interactively.
@@ -121,7 +114,7 @@ A web interface is available to demonstrate the authorization capabilities inter
121
114
```bash
122
115
# 1. Ensure services are running and data is initialized
123
116
docker-compose up -d
124
-
python3 examples/setup_environment.py# If not already done
117
+
python3 examples/setup_environment.py
125
118
126
119
# 2. Install web dependencies
127
120
pip install -r requirements.txt # Includes fastapi and uvicorn
@@ -130,11 +123,29 @@ pip install -r requirements.txt # Includes fastapi and uvicorn
130
123
python3 run_ui.py
131
124
```
132
125
133
-
The launcher will:
134
-
- ✅ Check that Weaviate, SpiceDB, and OpenAI are configured
135
-
- ✅ Verify documents are loaded
136
-
- 🚀 Start the FastAPI server
137
-
- 🌐 Open your browser to http://localhost:8000
126
+
The `setup-environment.py` file sets up Weaviate as the vector DB and SpiceDB with sample documents and department-based access control for the agentic RAG system.
127
+
128
+
We're creating a schema and writing relationships for a hierarchical permission model with users assigned to departments, department-wide document access, 3 cross-department collaboration grants, and 3 individual user exceptions.
129
+
130
+
The UI launcher will:
131
+
- Verify documents are loaded
132
+
- Starts the FastAPI server
133
+
- Open your browser to http://localhost:8000
134
+
135
+
Here are few sample prompts you can run:
136
+
137
+
Choose "Bob" from "Sales" as the user and the query as "What are the company handbook guidelines?"
138
+
139
+
You should see:
140
+
📊 Retrieved: 5
141
+
✅ Authorized: 3
142
+
❌ Denied: 2
143
+
144
+
Now run the same query as the "HR Manager". You should see:
0 commit comments