Rule-driven Collections

Describe a Collection in declarative terms — "every regulated PDF", "all NDAs from 2024" — and Kodori auto-includes matching documents.

Updated 2026-04-25

A rule-driven Collection auto-includes any document matching a set of predicates, on top of whatever you pin explicitly. Useful when you'd otherwise spend the day manually tagging — "everything in our NDA library", "every regulated PDF", "all 2024 BigCo correspondence".

Open any Collection at /collections/<id> and click "Add a rule" (or "Edit rule"). A rule is an AND of 1–8 predicates over document properties:

- Sensitivity is — exactly one of public / internal / confidential / restricted / regulated. - Type is — a MIME family (pdf, image, office, text, email). - MIME type equals — an exact MIME type, e.g. application/pdf. - Name contains — substring match on the display name (case-insensitive by default). - Has keyword / doc type — matches documents where metadata.keywords contains the value (exact), or metadata.docType equals it (case-insensitive). Use this for "every NDA" once you've tagged docs with the NDA keyword. - Created after / Created before — calendar bounds on the document's created timestamp.

Predicates AND together: "Type is PDF" + "Has keyword NDA" + "Created after 2024-01-01" surfaces NDAs uploaded since the start of 2024, in PDF form.

The "Include pinned members" toggle decides whether explicitly pinned documents union with the rule matches (default on) or whether the Collection is rule-only (uncheck — useful for living, query-shaped views).

Membership is computed at read time, so the rule reflects new documents the moment they're uploaded — there is no rebuild step. A pinned document is never excluded by the rule; rule predicates only widen membership unless you uncheck "Include pinned".

Asking the AI works too: "make this Collection auto-include every regulated PDF" or "add a rule: docType is invoice and created after 2024-01-01" — the agent calls setCollectionRule with the same predicate shape.