Skip to content

Conversation

@erinmikailstaples
Copy link
Contributor

@erinmikailstaples erinmikailstaples commented Sep 2, 2025

RAG + authentication example

SC-39081

Tutorial with OSO for authentication, PGVector for DB and RAG.

Before submitting

  1. Test Your Example: Ensure it runs correctly
  2. Update Documentation: Verify README is complete and accurate
  3. Check Dependencies: Ensure all dependencies are properly listed
  4. Environment Variables: Provide .env.example file
  5. Code Review: Self-review your code for quality

PR checklist

  • Example runs successfully
  • README.md is complete and accurate
  • Dependencies are properly listed
  • Environment variables are documented
  • Code follows style guidelines
  • Galileo integration is properly implemented
  • Tests pass (if applicable)
  • No sensitive data is included

Description

Brief description of what this example demonstrates.

Type of example

  • Agent
  • Chatbot
  • RAG
  • Dataset & Experiments

Language

  • Python
  • TypeScript

Key features

  • RAG search
  • Authentication with OSO

Testing

  • Example runs successfully
  • README instructions work
  • Galileo integration tested

Screenshots/Demo

Loom video here: https://www.loom.com/share/0da829a1c03a4538b4608a619e206c5e?sid=a31df0c3-db6c-4fea-9702-80e630a8bfc1

@erinmikailstaples erinmikailstaples self-assigned this Sep 2, 2025
@erinmikailstaples erinmikailstaples added cookbooks integration related to integrations with galileo labels Sep 2, 2025
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
@erinmikailstaples
Copy link
Contributor Author

Right now noticing the document store is having an issue, fixing here + running back by the Oso team.

@erinmikailstaples erinmikailstaples changed the title Healthcare Support Portal feat: Oso + Docker + Postgres Healthcare Support Portal feat: Oso + PGVector + Galileo Sep 3, 2025
Signed-off-by: Erin Mikail Staples <[email protected]>
Signed-off-by: Erin Mikail Staples <[email protected]>
@erinmikailstaples erinmikailstaples marked this pull request as ready for review September 8, 2025 18:43
@erinmikailstaples
Copy link
Contributor Author

@jimbobbennett mind taking a peek at this, i'm running black on it now.

Focadecombate
Focadecombate previously approved these changes Sep 11, 2025
Copy link
Contributor

@Focadecombate Focadecombate left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link

@avirath-kumar avirath-kumar left a comment

Choose a reason for hiding this comment

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

SE cookbook review

**Add Galileo for AI observability and monitoring:**
1. Get your Galileo API key from [app.galileo.ai](https://app.galileo.ai)
2. Add to `packages/rag/.env`: `GALILEO_API_KEY=your-galileo-key`
3. Test: `uv run python test_config.py`

Choose a reason for hiding this comment

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

likely same issue as line 173 - not loading .env file so returns invalid api key format, wrong DB URL, etc

test_config.py needs load_dotenv()


**5b. Test the Web Interface:**
1. 🌐 Open **http://localhost:3000**
2. 🔑 Login with: `[email protected]` / `secure_password`

Choose a reason for hiding this comment

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

username should be dr_smith not [email protected]

# Get authentication token
TOKEN=$(curl -s -X POST "http://localhost:8001/api/v1/auth/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected]&password=secure_password" | \

Choose a reason for hiding this comment

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

same issue with username in the auth api call -> should be dr_smith not [email protected]

updated script
`TOKEN=$(curl -s -X POST "http://localhost:8001/api/v1/auth/login"
-H "Content-Type: application/x-www-form-urlencoded"
-d "username=dr_smith&password=secure_password" |
python3 -c "import sys, json; print(json.load(sys.stdin)['access_token'])")

echo "Got auth token: ${TOKEN:0:20}..."`

**5b. Test the Web Interface:**
1. 🌐 Open **http://localhost:3000**
2. 🔑 Login with: `[email protected]` / `secure_password`
3. 📄 Upload a PDF document (medical guideline, research paper, etc.)

Choose a reason for hiding this comment

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

UI bugs

  • "Good afternoon, Dr. dr_smith" in UI on homepage
  • doc upload via ui button not working - UI error on click
  • can't access documents section of the UI at all - UI error

**Step 1: Check Dependencies**
```bash
# Run the validation script
./validate_environment.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Lots of bash scripts here - can we offer something that also works on Windows? Most enterprise customers use Windows.

cd sdk-examples/python/rag/healthcare-support-portal

# 2. Run automated setup
chmod +x setup.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update this in the repo to remove this step?

```

**Add Galileo for AI observability and monitoring:**
1. Get your Galileo API key from [app.galileo.ai](https://app.galileo.ai)
Copy link
Contributor

Choose a reason for hiding this comment

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

Console URL? It's not in the .env file

GALILEO_ENABLED=true
GALILEO_API_KEY=your-galileo-api-key-here
GALILEO_PROJECT_NAME=healthcare-rag
GALILEO_ENVIRONMENT=development
Copy link
Contributor

Choose a reason for hiding this comment

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

What is GALILEO_ENVIRONMENT?

# Galileo 2.0 Observability Configuration
GALILEO_ENABLED=true
GALILEO_API_KEY=your-galileo-api-key-here
GALILEO_PROJECT_NAME=healthcare-rag
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a log stream name, or console URL?


```bash
# Start database, backend services, and frontend
./run_all.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I need to stop this, or keep it running?

**5b. Test the Web Interface:**
1. 🌐 Open **http://localhost:3000**
2. 🔑 Login with: `dr_smith` / `secure_password`
3. 📄 Upload a PDF document (medical guideline, research paper, etc.)
Copy link
Contributor

Choose a reason for hiding this comment

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

How? Any sample docs I can use?

1. 🌐 Open **http://localhost:3000**
2. 🔑 Login with: `dr_smith` / `secure_password`
3. 📄 Upload a PDF document (medical guideline, research paper, etc.)
4. 🤖 Ask a question: *"What are the key recommendations in this document?"*
Copy link
Contributor

Choose a reason for hiding this comment

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

How? Where do I ask a question?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is way too big - can we strip out a lot of it as it's daunting. We need to get users quickly running the example and seeing traces.

3. 📄 Upload a PDF document (medical guideline, research paper, etc.)
4. 🤖 Ask a question: *"What are the key recommendations in this document?"*
5. ✅ Verify you get an AI response with document sources!

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see anything in Galileo after asking a question. What log stream does it log to, as this is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cookbooks integration related to integrations with galileo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants