Documentation Index
Fetch the complete documentation index at: https://launchpad.datalumina.com/llms.txt
Use this file to discover all available pages before exploring further.
Retrieval Augmented Generation (RAG) grounds LLM responses in documents you control, rather than relying only on what the model learned during training. This example ships as
RagExampleWorkflow in app/launchpad/workflows/examples/pgvector_rag/.pgvector extension enabled.
Why pgvector?
- Simple setup — no additional vector database; the default PostgreSQL service already has pgvector available.
- Single source of truth — vectors live next to your relational data, so retrieval queries can join against business tables.
- Cost effective — no separate vector database to operate or pay for.
Components
The workflow is a two-node pipeline:RetrievalNode → GenerationNode.
| File | Purpose |
|---|---|
app/launchpad/workflows/examples/pgvector_rag/schema.py | RagExampleEventSchema — accepts a single query: str. |
app/launchpad/workflows/examples/pgvector_rag/services.py | PgvectorRAGService — wraps vecs + OpenAI embeddings; exposes get_embedding, get_collection, upsert, parse_results, count_tokens, disconnect. |
app/launchpad/workflows/examples/pgvector_rag/nodes/retrieval_node.py | RetrievalNode — embeds the query, performs a cosine-distance lookup, and writes the hits to the context. |
app/launchpad/workflows/examples/pgvector_rag/nodes/generation_node.py | GenerationNode — grounds an agent response in the retrieved chunks and returns answer, sources, confidence. |
app/launchpad/workflows/examples/pgvector_rag/workflow.py | RagExampleWorkflow registered as WorkflowRegistry.PGVECTOR_RAG. |
Retrieval
Generation
Running the example
Start the stack
From
docker/, run ./start.sh to bring up the API, Celery worker, Redis, and PostgreSQL with pgvector. Supabase services and Caddy stay disabled unless you uncomment them in docker-compose.yml.Customization
- Swap embedding model — pass a different
embedding_modeltoPgvectorRAGService(defaulttext-embedding-3-small, 1536 dims). - Change retrieval — adjust
limit,measure, or metadata filters oncollection.query(...)inRetrievalNode. - Change generation model — update
model_provider/model_nameinGenerationNode.get_agent_config.