Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / RAG & Knowledge Bases

RAG & Knowledge Bases

Check consent before pgvector indexing in Postgres with OpenAI and Slack

On a schedule, it answers questions from your own knowledge base with OpenAI / ChatGPT using PGVector, Postgres, Slack.

What it does

## Check consent before embedding records into a pgvector index Hundreds of workflows load documents, chunk them and push them into a vector store. Almost none ask whether they are allowed to. This one puts a gate in front of the index: every record is checked against a consent register first, and anything without a lawful basis is refused with its reason. ### How it works Records waiting to be indexed and the consent register are read separately, because in real setups the two live in different systems. Each record then gets one decision with six independent refusal grounds. Special category data is refused outright, because it needs its own Article 9 condition rather than ordinary consent. Withdrawn consent stops anything new being indexed. An objection to profiling refuses the record even when consent exists. Retention that has run out refuses it even though the consent was once valid. And purpose limitation is the one most pipelines get wrong: consent for support or marketing is not consent to be embedded into a model index. A record whose register entry is missing the fields the decision needs is held, not refused. Undecidable is a third answer, and guessing either way is what this exists to prevent. Eligible records are embedded. Every decision and its ground goes into an inclusion manifest, so months later you can prove exactly what was in the index and why. ### Setup 1. Create the consent register, documents and manifest tables, and enable the pgvector extension. 2. Connect Postgres, an embeddings provider and Slack. 3. Open Consent Rules and set required_purpose to the exact purpose string your register uses. A refusal here is a legal decision, so the ground is recorded, never just a count.

The steps

  1. Index Run Every Night
  2. Consent Rules
  3. Read The Records Waiting To Be Indexed
  4. Read The Consent Register
  5. Match Each Record To Its Consent
  6. Decide If This Record May Be Embedded
  7. Where Does This Record Go?
  8. Embed In Batches
  9. Add To The Index
  10. Turn The Text Into Vectors
  11. Load The Record Text
  12. Split Long Records
  13. Mark The Record As Indexed
  14. Write The Inclusion Manifest

21 steps in total.

Similar automations