fleet-memory/hindsight-docs/docs/developer/api
Nicolò Boschi 5de793eec7
feat: compound tag filtering via tag_groups (#562)
* feat: add compound tag filtering via tag_groups

Adds tag_groups to RecallRequest and ReflectRequest to express arbitrary
boolean tag predicates: leaf {tags, match}, and/or/not compounds.
Top-level groups are AND-ed. Existing tags/tags_match unchanged.

Examples:
  Step filter AND user scope:
    tag_groups: [{tags: ["step:5","step:8"], match: "any_strict"},
                 {tags: ["user:alice"], match: "all_strict"}]
  Exclusion:
    tag_groups: [{tags: ["user:alice"], match: "all_strict"},
                 {not: {tags: ["archived"], match: "any_strict"}}]

- Recursive SQL builder (build_tag_groups_where_clause) threads through
  all 4 retrieval strategies (semantic/BM25, temporal, graph, MPFP)
- Python-side filter (filter_results_by_tag_groups) for post-traversal
- 22 new unit tests
- OpenAPI spec + all clients regenerated (Rust, Python, TypeScript, Go)

* fix: add tag_groups: None to Rust CLI struct initializers

* fix: add tag_groups: None to Rust client test RecallRequest initializer

* feat: reject tags+tag_groups together, add tag_groups integration tests

- Add model_validator to RecallRequest and ReflectRequest that returns 422
  when both `tags` and `tag_groups` are set (mutually exclusive)
- Add 5 integration tests for tag_groups compound filtering:
  * validation: 422 when both fields are set
  * AND filter: two leaf groups (step scope AND user scope)
  * OR compound: user:alice OR user:bob
  * NOT compound: user:alice AND NOT archived
  * Nested: user:alice AND (step:5 OR step:8)

* ci: trigger CI run
2026-03-13 14:30:11 +01:00
..
documents.mdx feat: change tags for a document (#517) 2026-03-07 09:00:13 +01:00
main-methods.mdx chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
memory-banks.mdx feat: add source facts token limits to consolidation and recall (#509) 2026-03-06 13:01:33 +01:00
mental-models.mdx feat: mental model history tracking and UI diff view (#516) 2026-03-06 17:50:48 +01:00
operations.md feat: add manual retry for failed async operations (#537) 2026-03-10 17:16:11 +01:00
quickstart.mdx docs: revamp sidebar with icon grids and language support (#563) 2026-03-13 14:12:42 +01:00
recall.mdx feat: compound tag filtering via tag_groups (#562) 2026-03-13 14:30:11 +01:00
reflect.mdx doc: improve api explanation (#415) 2026-02-20 17:02:01 +01:00
retain.mdx feat: support timestamp="unset" to retain content without a date (#465) 2026-03-02 12:03:23 +01:00
webhooks.mdx feat: webhook system with retain.completed event, UI, and docs (#487) 2026-03-04 14:17:01 +01:00