# Smoke-Test a RAG Pipeline on Databricks Lakebase

Run the full RAG pipeline on a small demo corpus of 25 passages. Use it to check your Databricks setup before you build with real data.

- Level: Beginner
- Duration: About 20 min
- Cost: Free tier
- Technologies: RAG, pgvector, Databricks Lakebase, Databricks Apps

## What you will build

- The same RAG pipeline as the SEC filings lab, on 25 invented passages
- A Lakebase Postgres project with pgvector enabled
- A small RAG app deployed to Databricks Apps

## Prerequisites

- A Databricks Free Edition account
- The Databricks CLI, logged in with databricks auth login
- Python 3.9 or newer with pip

## Run it

```bash
pip install 'labagent[rag]'
databricks auth login
labagent launch rag-lakebase --name demo
labagent destroy rag-lakebase --name demo
```

## Steps

1. Preflight: Check your login, the serving endpoints, and the Free Edition project limit.
2. Create the Lakebase project: Start the Postgres project that holds the vectors.
3. Load the demo corpus: Chunk the passages, embed them, and load them.
4. Build the indexes: Add vector, full-text and metadata indexes.
5. Deploy the app: Publish the Databricks App and open it.

## FAQ

### Why use a demo corpus?

It is a smoke test. If this lab runs, your login, serving endpoints and project limit are set up correctly.

### Is the data real?

No. The 25 passages are invented. Use the SEC filings lab for real documents.

### Does this lab cost money?

It runs on Databricks Free Edition. Free Edition allows one Lakebase project, and apps stop after 24 hours.

## Next steps

- Lab page: https://becloudready.com/labs/catalog/rag-lakebase
- Private environments for your team: https://becloudready.com/labs/teams
- Corporate workshops: https://becloudready.com/workshops
