Cloud-agnostic serverless template for document chunking, Gemini embedding, and pgvector upsert.
- Core vector pipeline is independent from cloud providers.
- Entry points are split into provider adapters (AWS/GCP/Azure/OCI).
- Domain customization is isolated via domain adapter registry.
- Package management is standardized with
uv.
src/
├─ entrypoints/
│ ├─ handler.py # Cloud-agnostic core request handler
│ ├─ lambda_handler.py # Backward-compatible AWS alias
│ └─ providers/
│ ├─ aws_lambda.py
│ ├─ gcp_http.py
│ ├─ azure_function.py
│ └─ oci_function.py
├─ pipelines/
├─ models/
├─ services/
├─ chunkers/
├─ embedders/
├─ repositories/
├─ db/
└─ utils/
uv syncOptional cloud adapter dependencies:
uv sync --extra gcp
uv sync --extra azure
uv sync --extra oci- Copy
.env.exampleto.env - Fill Gemini and Postgres values
- Copy
src/models/domain_template.pyadapter - Set a unique
key(for example:legal-doc,support-ticket) - Register adapter in
VectorUpsertPipeline(self._domains.register(...)) - Send request with matching
domain
This keeps domain logic isolated so the same template works across projects.
- AWS Lambda:
src.entrypoints.providers.aws_lambda.handler - Google Cloud Functions:
src.entrypoints.providers.gcp_http.handler - Azure Functions:
src.entrypoints.providers.azure_function.main - Oracle Cloud Functions:
src.entrypoints.providers.oci_function.handler
All adapters call src.entrypoints.handler.handle_payload, so business logic remains provider-neutral.