8000 feat(workflows): an entity filter node by adeelahmad · Pull Request #562 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content
8000

feat(workflows): an entity filter node - #562

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-tk5msj
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-tk5msj

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: keeping only some of the entities an extract node found meant a generic Filter with a hand-written test per rule.

After: an Entity filter node (a primitive, so every workflow scope has it) keeps a list's entities by the types it keeps or skips, a stop list of names (matched case and spacing aside, as entities are joined), a minimum name length, a name pattern (a regular expression, checked as match trees check theirs: no runaway backtracking, a time limit per name), and how often each is said (its mentions, else how often the list names it). Anything in the list that isn't an entity is left out. The canvas has its settings panel, card summary and Publish checks.

How: flow.entity_filter beside the other primitives in flow.py, reusing analyze.ent_key and match's pattern check and search; workflow-model.ts and node-settings.tsx for the canvas.

Motivation and Context

One of the three node types in the parked "New workflow node types" ask (HTTP call, template render, entity filter), now started. The HTTP call node follows in its own PR; template render is the existing template primitive.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests (test_entity_filter_keeps_the_entities_asked_for, workflow-flow.test.ts).
  • docs/processing.md (Workflows) updated.
  • CHANGELOG: n/a, the title says it.

Done questions

  • Goal: the entity filter node from the ask; merged on green.
  • Agents: workflows are built and tried over the REST API (/api/v1/workflows, the catalog lists the node and its settings).
  • Zero setup: nothing to install or configure.
  • Fewest clicks: an empty filter keeps everything, so dropping it in changes nothing until a field is filled.
  • Configurable: n/a, no new setting; the node's settings live on the canvas.
  • Light: pure Python over the list, no new dependency.
  • Private and secure: n/a, no new surface; patterns go through match's guarded regex.
  • Cost: no model call.
  • User decides: nothing changes until someone adds the node; defaults unchanged.
  • Upgrades: n/a, no stored-data change.
  • Honest: README and docs/requirements.md list it as built with its checks.
  • Tests, docs and generated files: tests and docs added; no OpenAPI change.
  • Open standards: n/a; no new dependency.
  • Reported in the project thread. Refine later: "only entities already in the graph / only new ones".
  • Reuse: analyze.ent_key, match._pattern_value and match._search.

Generated by Claude Code

Keeps a list's entities by type, a stop list of names, length, a pattern
or how often they're said, between extraction and saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j3Y4Dh3DLGwyFYBH23QML
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad merged commit 7cd473f into main Oct 18, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-tk5msj branch October 18, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0