What are NodeSets?
A NodeSet lets you group parts of your AI memory at the dataset level. You create them as a simple list of tags when adding data to Cognee:node_set must be a list of non-empty strings, even for a single tag (["projectA"], not "projectA"). Any other shape raises InvalidNodeSetError before anything is stored. Content that incremental loading skips as already added is not checked, so it raises nothing. The one exception is remember(content_type="skills"), which also accepts a single string.node_set raise the same error when cognify reads them instead of being left untagged. Fix each one with update(), passing its data_id, its content, its dataset_id, and a list-shaped node_set. With the default incremental loading, re-adding identical content with add() or remember() is skipped as already added, so it leaves the stored value in place.
These tags travel with your data into the knowledge graph, where they become first-class nodes connected with belongs_to_set edges — and you can later filter retrieval to only those subsets.
How they flow through Cognee
- Remember:
- NodeSets are attached as simple tags to datasets or documents
- This happens when you first ingest data
- The underlying graph-building step carries them into Documents, Chunks, and the entities extracted from those chunks — and, for a whole repository passed to
add()orremember(), into every code graph node (see Code Graph) - They are materialized as real
NodeSetnodes in the graph and connected withbelongs_to_setedges
- Recall:
- NodeSets help define meaningful retrieval subsets
- Use
recall()withnode_nameandnode_name_filter_operatorto scope retrieval to specific node-set subsets
- Improve:
- The default improvement path runs memify-style enrichment
- Related enrichment flows can create node sets such as
coding_agent_rulesoruser_sessions_from_cache
Why they matter
- Provide a lightweight way to organize and tag your data
- Enable graph-based filtering, traversal, and reporting
- Ideal for creating project-, domain-, or user-defined subsets of your knowledge graph
See it in action
NodeSet Grouping is a short runnable guide that walks through all of this end to end: it remembers three passages under overlapping labels —["AI", "FinTech"], ["AI"], and ["MedTech"] — renders the resulting graph so you can trace the belongs_to_set edges, and shows how to scope a later recall() to one group with node_name.
Remember
Where NodeSets are first attached
Improve
How enrichment flows add more NodeSet-based structure
Search
Use NodeSets as anchors in queries