Fluid Forge
Why Forge
Concepts
Get Started
  • Consume a Data Product
  • See it run
  • Demos
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • MCP Output Port — Serve to AI Agents
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Agent Policy (concept)
  • MCP Output Port — Serve to Agents
  • MCP deep-dive
  • AI-assisted authoring
  • LLM providers & backends
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
Why Forge
Concepts
Get Started
  • Consume a Data Product
  • See it run
  • Demos
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • MCP Output Port — Serve to AI Agents
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Agent Policy (concept)
  • MCP Output Port — Serve to Agents
  • MCP deep-dive
  • AI-assisted authoring
  • LLM providers & backends
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
  • Introduction

    • Home
    • Why Fluid Forge
    • Getting Started
    • Snowflake Quickstart
    • See it run
    • Forge Data Model
    • Vision & Roadmap
    • Playground
    • FAQ
  • Concepts

    • Concepts
    • Builds, Exposes, Bindings
    • What is a contract?
    • Quality, SLAs & Lineage
    • Governance & Policy
    • Agent Policy (LLM/AI governance)
    • Providers vs Platforms
    • Fluid Forge vs alternatives
  • Data Products

    • Consume a Data Product
    • Product Types — SDP, ADP, CDP
  • Walkthroughs

    • Walkthrough: Local Development
    • Source-Aligned: Postgres → DuckDB → Parquet
    • AI Forge And Data-Model Journeys
    • Walkthrough: MCP Output Port
    • Walkthrough: Deploy to Google Cloud Platform
    • Walkthrough: Snowflake Team Collaboration
    • Declarative Airflow DAG Generation - The FLUID Way
    • Generating Orchestration Code from Contracts
    • Jenkins CI/CD for FLUID Data Products
    • Universal Pipeline
    • The 11-Stage Pipeline
    • End-to-End Walkthrough: Catalog → Contract → Transformation
  • CLI Reference

    • CLI Reference
    • Core workflow

      • fluid init
      • fluid demo
      • fluid forge
      • fluid validate
      • fluid plan
      • fluid apply
      • fluid diff
      • fluid status
    • Build & ship

      • fluid bundle
      • fluid generate
      • fluid generate artifacts
      • fluid validate-artifacts
      • fluid verify-signature
      • fluid generate iac
      • fluid generate-airflow
      • fluid generate-pipeline
      • fluid generate vector
      • fluid viz-graph
      • fluid publish
      • fluid ship
      • fluid rollback
      • fluid schedule-sync
    • AI & Agents

      • fluid ai
      • fluid agents
      • fluid mission
      • fluid mcp
      • fluid memory
      • fluid stats
      • fluid skills
    • Quality & governance

      • fluid test
      • fluid verify
      • fluid contract-tests
      • fluid contract-validation
      • fluid policy
      • fluid policy check
      • fluid policy compile
      • fluid policy apply
    • Standards & interoperability

      • fluid odps
      • fluid odps-bitol
      • fluid odcs
      • fluid export
      • fluid export-odps
      • fluid exporters
      • fluid import
      • fluid market
      • fluid datamesh-manager
    • Project & workspace

      • fluid product-new
      • fluid product-add
      • fluid workspace
      • fluid contract
      • fluid split
      • fluid config
      • fluid providers
      • fluid plugins
      • fluid provider-init
      • fluid auth
      • fluid secrets
      • fluid ide
      • fluid scaffold-ci
      • fluid scaffold-composer
      • fluid scaffold-ide
      • fluid docs
      • fluid runs
      • fluid retention
      • fluid describe
      • fluid doctor
      • fluid roadmap
      • fluid version
    • Catalog adapters

      • Source Catalog Integration (V1.5)
      • Publishing to a Catalog — Overview
      • BigQuery Catalog
      • Snowflake Horizon Catalog
      • Databricks Unity Catalog
      • Google Dataplex Catalog
      • AWS Glue Data Catalog
      • DataHub Catalog
      • Data Mesh Manager Catalog
      • OpenMetadata Catalog
    • CLI by task

      • CLI by task
      • Add quality rules
      • Add agent governance
      • Debug a failed pipeline run
      • Switch clouds with one line
  • Recipes

    • Recipes
    • Recipe — add a quality rule
    • Recipe — switch clouds with one line
    • Recipe — tag PII in your schema
    • Write a contract that consumes another contract
    • Generate per-environment overlays
  • SDK & Plugins

    • SDK & Plugins
    • Quickstart — your first plugin
    • Examples

      • Runnable examples
      • Example: hello-scaffold — the minimal viable plugin
      • Example: gitlab-ci-scaffold — generate a complete CI project
      • Example: steward-validator — a custom governance rule
      • Example: prod-key-guard — apply-time invariant check
    • Journeys

      • Journeys
      • Your own CI/CD

        • You have your own CI/CD setup, no problem
        • GitLab CI — the bundle template
        • GitHub Actions — the bundle template
        • Jenkins — the bundle template
        • CircleCI — the bundle template
      • You have a strict project layout, no problem
      • You have governance rules, no problem
      • You want a check at apply time, no problem
    • Reference

      • Reference
      • Roles reference
      • Entry points reference
      • Trust model
      • Packaging
      • Companion packages
  • Providers

    • Providers
    • Provider Architecture
    • GCP Provider
    • AWS Provider
    • Snowflake Provider
    • Local Provider
    • Creating Custom Providers
    • Provider Roadmap
  • AI & Agents

    • MCP Server
    • Built-in And Custom Forge Guidance
    • Forge Discovery Guide
    • Forge Memory Guide
    • Authoring Forge Tools
    • Guided fluid forge UX
    • LLM Providers
    • LiteLLM Backend
    • Capability Warnings
    • Cost Tracking
    • FLUID Forge Contract GPT Packet
    • Agentic Primitives
  • Operate & Deploy

    • Operating in CI
    • Production Troubleshooting
    • Airflow Integration
    • Blueprints
    • Source-Aligned Acquisition
  • Govern & Secure

    • Governance, Compliance & the Business Case
    • Governance & Compliance
    • Network Safety
    • Credential Resolver — Security Model
  • Configuration & Reference

    • Environment Variables
    • Typed Errors
    • Typed CLI Errors
    • API Stability — fluid_build.api
  • Architecture & Releases

    • V1.5 Catalog Integration — Architecture Deep-Dive
    • V1.5 + V2 Hardening — Release Notes
  • Project

    • Contributing to Fluid Forge
    • Fluid Forge Docs Baseline: CLI 0.14.0
    • Fluid Forge Docs Baseline: CLI 0.13.0
    • Fluid Forge Docs Baseline: CLI 0.12.0
    • Fluid Forge Docs Baseline: CLI 0.11.0
    • Fluid Forge Docs Baseline: CLI 0.10.0
    • Fluid Forge Docs Baseline: CLI 0.9.0
    • Fluid Forge Docs Baseline: CLI 0.8.11
    • Fluid Forge Docs Baseline: CLI 0.8.10
    • Fluid Forge Docs Baseline: CLI 0.8.9
    • Fluid Forge Docs Baseline: CLI 0.8.8
    • Fluid Forge Docs Baseline: CLI 0.8.7
    • Fluid Forge Docs Baseline: CLI 0.8.6
    • Fluid Forge Docs Baseline: CLI 0.8.5
    • Fluid Forge Docs Baseline: CLI 0.8.4
    • Fluid Forge Docs Baseline: CLI 0.8.3
    • Fluid Forge Docs Baseline: CLI 0.8.0
    • Fluid Forge Docs Baseline: CLI 0.7.11
    • Fluid Forge Docs Baseline: CLI 0.7.9
    • Fluid Forge v0.7.1 - Multi-Provider Export Release

fluid generate vector

Review-only emit of a pgvector RAG target from a FLUID contract. For every expose bound to pgvector, it compiles the ai-embeddable columns into an embeddings table + ANN index so the data product can be consumed directly by retrieval-augmented generation (RAG) / AI applications.

Stable since 0.12.0 (shipped as a preview in 0.11.0)

The fluid generate vector command ships in v0.11.0. As of v0.12.0, schema 0.7.5 is promoted to stable and is the default for untagged contracts — the vectorConfig binding block is default-available and no longer needs an explicit fluidVersion: "0.7.5" opt-in pin. (Contracts that pin an older fluidVersion must bump to 0.7.5+ to use it.) See Product types & the schema lifecycle.

What it emits

fluid generate vector <contract> writes two review artifacts to the output directory:

FileContents
embeddings.sqlCREATE EXTENSION IF NOT EXISTS vector, a one-row-per-chunk embeddings table (<expose>_embeddings), and the ANN index.
vector_manifest.jsonRAG provenance — the embedding model, dimensions, distance metric, source key, and the text columns being embedded.

The embeddings table follows the standard RAG shape:

CREATE TABLE kb_article_embeddings (
    id            bigserial PRIMARY KEY,
    source_id     bigint,              -- FK back to the source row (sourceKeyColumn)
    chunk_index   int,
    chunk_text    text,
    embedding     vector(1536),        -- dimensions from vectorConfig
    embedding_model text,
    created_at    timestamptz DEFAULT now()
);
CREATE INDEX kb_article_embeddings_embedding_idx
    ON kb_article_embeddings USING hnsw (embedding vector_cosine_ops);

Only columns the ai_ready agent labels ai-embeddable: "true" become embedding targets — every other column is skipped, so PII and structural columns never enter the vector store by accident.

Syntax

fluid generate vector [contract] [--out DIR] [--env NAME]
OptionDescription
contractPath to the FLUID contract file (contract.fluid.yaml).
--out, -o DIROutput directory for embeddings.sql + vector_manifest.json. Default runtime/vector.
--env NAMEEnvironment overlay name (matches your contract's overlay block, e.g. dev / staging / prod).

The vectorConfig binding

Declare a vector expose bound to pgvector, and drive the DDL from binding.vectorConfig:

fluidVersion: "0.7.5"          # stable since 0.12.0 — also the default for untagged contracts
# ...
exposes:
  - exposeId: kb_articles
    kind: vector
    binding:
      platform: pgvector
      format: pgvector_table
      location:
        database: rag
        schema: public
        table: kb_articles
      vectorConfig:
        dimensions: 1536                       # must match your embedding model
        embeddingModel: text-embedding-3-small
        vectorType: vector                     # pgvector column type
        indexType: hnsw                        # hnsw (default) | ivfflat | none
        distanceMetric: cosine                 # cosine (default) | l2 | inner_product | l1
        sourceKeyColumn: article_id            # FK back to the source row
        table: kb_article_embeddings           # embeddings table name
        hnsw:
          m: 16
          efConstruction: 64
vectorConfig fieldMeaning
dimensionsVector width — must equal your embedding model's output dimension (e.g. 1536 for text-embedding-3-small).
embeddingModelThe model that produced the vectors; recorded in the manifest for provenance.
indexTypehnsw (default, best recall/speed), ivfflat, or none (exact scan).
distanceMetriccosine (default) / l2 / inner_product / l1 — selects the pgvector operator class on the index (vector_cosine_ops, etc.).
sourceKeyColumnColumn that links each chunk back to its source row.
hnsw / ivfflatIndex-tuning knobs (m, efConstruction for HNSW; lists for IVFFlat).

Examples

# Emit the embeddings DDL + manifest for review
fluid generate vector contract.fluid.yaml

# Choose an output directory
fluid generate vector contract.fluid.yaml --out runtime/vector

# Per-environment overlay
fluid generate vector contract.fluid.yaml --env staging

Inspect embeddings.sql and vector_manifest.json, then run the SQL against your Postgres+pgvector instance and point your RAG pipeline at the resulting table.

How it fits

  • Upstream: the ai_ready agent stamps ai-embeddable: "true" on safe free-text columns during authoring. This port consumes exactly those labels.
  • Identifiers: every emitted table / index / column name is routed through FLUID's central SQL-identifier validation before interpolation — no raw string concatenation into DDL.
  • Prior art: the DDL grammar follows the pgvector README; the (model, dimensions, embed-fields) config surface mirrors established embedding-sink connectors.

See also

  • fluid generate — the parent command and its other targets.
  • Builds, exposes & bindings — how output ports are declared.
  • Consuming a data product.
Edit this page on GitHub
Last Updated: 7/18/26, 8:34 AM
Contributors: fas89
Prev
fluid generate-pipeline
Next
fluid viz-graph