createCommunityBuilder
@forge/monorepo / backend/src / createCommunityBuilder
Function: createCommunityBuilder()
createCommunityBuilder(
deps):object
Defined in: backend/src/knowledge/communities.ts:353
Rebuilds the community hierarchy, and re-summarises only what changed.
This is where AC-5's "incremental" honestly lives, and it is worth being precise about the split rather than claiming more than is true:
- Clustering is global and cheap. Community detection is global by nature — one entity moving can change every level — so the whole graph is re-clustered. It is arithmetic over ids, with no model calls, and pretending to do it incrementally would mean a partition that disagrees with itself.
- Summarisation is incremental and expensive. One model call per community, and that is the cost worth avoiding. A community whose membership fingerprint is unchanged keeps its summary untouched.
So changing one source re-clusters everything and re-summarises the handful of communities that actually moved. The staleness window is therefore zero for structure and one rebuild for summaries, and a community caught between the two is visibly stale rather than silently wrong.
Parameters
deps
Returns
object
summariserId
summariserId:
string|null
rebuild()
rebuild(
context):Promise<CommunityRebuildResult>
Parameters
context
tenantId
Returns
Promise<CommunityRebuildResult>