How pathwaycom/llm-app works
Purpose and Repository Shape
This is a catalog of independently deployable Python AI-pipeline templates built on Pathway Live Data Framework. It is not one unified application: each template owns its runtime entry point, dependencies, container image, and often deployment metadata. Primary executable entry points are template-local app.py files, e.g. templates/question_answering_rag/app.py, templates/document_indexing/app.py, and templates/unstructured_to_sql_on_the_fly/app.py.
Shared Execution Model
Templates use Pathway for continuously synchronized ingestion, in-memory transformation/indexing, and HTTP request serving. Pathway is a Python library backed by a Rust engine; it consolidates streaming data processing, retrieval index, cache, and API serving rather than requiring an external vector DB, Redis, or FastAPI service. Template containers are defined by paths such as templates/question_answering_rag/Dockerfile and templates/multimodal_rag/Dockerfile.
Live Ingestion and Indexing
The dominant flow is: connected document source → parsing/chunking/embedding → continuously updated search index → HTTP retrieval endpoint → optional LLM-generated answer. File-backed sample corpora illustrate source boundaries, including templates/document_indexing/files-for-indexing/ and templates/question_answering_rag/data/. The framework supports filesystem and external live sources such as Google Drive, SharePoint, S3, Kafka, PostgreSQL, and real-time APIs.
RAG Application Variants
Core RAG examples provide alternate retrieval and generation designs:
• Basic hosted-model QA RAG: templates/question_answering_rag/app.py, with optional Streamlit client at templates/question_answering_rag/ui/ui.py.
• Adaptive RAG, intended to reduce retrieval/generation token cost: templates/adaptive_rag/app.py.
• Local/private RAG using Mistral and Ollama: templates/private_rag/app.py.
• GPT-4o-assisted multimodal document parsing and RAG: templates/multimodal_rag/app.py.
• Video retrieval using TwelveLabs descriptions and multimodal embeddings: templates/video_rag_twelvelabs/app.py.
Retrieval Service Boundary
templates/document_indexing/app.py is the focused live vector-store/retriever service, intended to be consumed by arbitrary frontends or LangChain/LlamaIndex applications rather than necessarily generating answers itself. Pathway’s built-in vector indexing uses usearch; hybrid/full-text retrieval uses Tantivy. A related MCP-facing document-store variant is exposed from templates/document_store_mcp_server/app.py, with local multi-service execution in templates/document_store_mcp_server/docker-compose.yml.
Structured-Data and Domain Pipelines
The unstructured-to-SQL template separates document extraction from relational query execution: financial PDFs are transformed into structured data, loaded into PostgreSQL, and queried through LLM-generated SQL. Its pipeline entry is templates/unstructured_to_sql_on_the_fly/app.py; database initialization is templates/unstructured_to_sql_on_the_fly/postgres/init-db.sql; orchestration is templates/unstructured_to_sql_on_the_fly/docker-compose.yml. This is the main template with a material external persistence boundary.
Deployment and User-Facing Surfaces
Most templates package backend deployments with Dockerfile, Python requirements, and Pathway deployment descriptors (app.yaml), for example templates/adaptive_rag/app.yaml and templates/slides_ai_search/app.yaml. Multi-container stacks use Compose where a UI, reverse proxy, or database is needed: templates/slides_ai_search/docker-compose.yml includes an Nginx component at templates/slides_ai_search/nginx/nginx.conf; UI-capable templates use Streamlit or lightweight Python servers such as templates/drive_alert/ui/server.py.
Main entry points: document_indexing/app.py Document indexing service · unstructured_to_sql_on_the_fly/app.py Unstructured-to-SQL · docker-compose.yml Local multi-service stacks · question_answering_rag/app.py Hosted QA RAG
Components 18
Shared runtime
Pathway provides continuous processing, indexing, and HTTP serving.
- Live document sources · Filesystem and external sources continuously feed templates.
- Pathway runtime · Combines streaming transforms, retrieval, cache, and HTTP serving.
- Parse, chunk, embed
- Live search index · Continuously updated vector, hybrid, and full-text retrieval.
- HTTP retrieval API
RAG templates
Independently deployable retrieval and answer-generation examples.
- Hosted QA RAG
templates/question_answering_rag/app.py - QA Streamlit UI
templates/question_answering_rag/ui/ui.py - Adaptive RAG · Retrieval and generation design optimized for token cost.
templates/adaptive_rag/app.py - Private RAG · Local Mistral and Ollama-based RAG.
templates/private_rag/app.py - Multimodal RAG · GPT-4o-assisted document parsing and RAG.
templates/multimodal_rag/app.py - Video RAG · TwelveLabs descriptions and multimodal embeddings.
templates/video_rag_twelvelabs/app.py
Specialized pipelines
Focused retrieval, MCP, and structured-data templates.
- Document indexing service · Live vector-store API for arbitrary clients and frameworks.
templates/document_indexing/app.py - MCP document store
templates/document_store_mcp_server/app.py - Unstructured-to-SQL · Extracts financial PDFs and serves LLM-generated relational queries.
templates/unstructured_to_sql_on_the_fly/app.py - PostgreSQL · Structured extracted data and SQL execution boundary.
templates/unstructured_to_sql_on_the_fly/postgres/init-db.sql
Deployment surfaces
Containers and multi-service local stacks.
- Template containers · Each template owns its runtime image and dependencies.
templates/question_answering_rag/Dockerfile - Local multi-service stacks · Orchestrates UI, proxy, database, or MCP companion services.
templates/unstructured_to_sql_on_the_fly/docker-compose.yml - Slides reverse proxy
templates/slides_ai_search/nginx/nginx.conf
Connections 19
- Live document sources → Pathway runtime: streams into
- Pathway runtime → Parse, chunk, embed: runs
- Parse, chunk, embed → Live search index: updates
- Live search index → HTTP retrieval API: serves retrieval
- Hosted QA RAG → Pathway runtime: uses
- QA Streamlit UI → Hosted QA RAG: queries
- Adaptive RAG → Pathway runtime: uses
- Private RAG → Pathway runtime: uses
- Multimodal RAG → Pathway runtime: uses
- Video RAG → Pathway runtime: uses
- Document indexing service → HTTP retrieval API: exposes
- Document indexing service → Pathway runtime: builds on
- MCP document store → Document indexing service: MCP-facing variant
- Unstructured-to-SQL → Pathway runtime: extracts with
- Unstructured-to-SQL → PostgreSQL: loads and queries
- Template containers → Hosted QA RAG: packages
- Local multi-service stacks → Unstructured-to-SQL: orchestrates
- Local multi-service stacks → PostgreSQL: starts
- Slides reverse proxy → Local multi-service stacks: included by slides stack