Skip to content

feat(behaviors): tf.behaviors.discover() — emergent behavior discovery - #5

Merged
rrader26 merged 1 commit into
mainfrom
feat/behaviors-discover
Jul 2, 2026
Merged

feat(behaviors): tf.behaviors.discover() — emergent behavior discovery#5
rrader26 merged 1 commit into
mainfrom
feat/behaviors-discover

Conversation

@rrader26

Copy link
Copy Markdown
Contributor

The final slice of behaviors.discover — the public SDK method. Completes the path: engine core (#39) → DiscoverBehaviors RPC (#40) → HTTP proxies (memory-thinkfleet #35, #36) → SDK.

What

tf.behaviors.discover(params?)POST /lattice/discover. Returns clusters of like-behaving subjects the engine found in the data (not a fixed menu):

const { behaviors } = await tf.behaviors.discover()
for (const b of behaviors) {
  console.log(`${b.label}${(b.prevalence*100).toFixed(0)}% of subjects, stability ${b.stability.toFixed(2)}`)
}

DiscoveredBehavior: label, prevalence, stability (cohesion), size, memberSubjects (medoid first), exemplarEvidence. An empty result means the engine abstained — not enough signal — never "no behaviors exist".

Notes

  • New BehaviorsResource wired into the client as tf.behaviors; types exported (DiscoverParams, DiscoveredBehavior, DiscoverResult).
  • Depends on memory-thinkfleet #36 (the /lattice/discover route) being deployed for runtime; compiles independently.

Verification

tsc clean; tsup build emits ESM/CJS/DTS; tf.behaviors.discover + types public in dist/index.d.ts.

Remaining (engine follow-ups, separate)

  • LLM naming of discovered clusters (neuro-symbolic)
  • promotion to behavior_pattern + feed into prediction features

🤖 Generated with Claude Code

Adds a BehaviorsResource exposing discover(), posting to POST /lattice/discover.
Returns clusters of like-behaving subjects (DiscoveredBehavior: label, prevalence,
stability, size, memberSubjects, exemplarEvidence) sorted most-common-and-cohesive
first. An empty result means the engine abstained — not enough signal — never
'no behaviors'. Completes the behaviors.discover path end-to-end:
engine core -> DiscoverBehaviors RPC -> HTTP proxies -> SDK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 merged commit ff95641 into main Jul 2, 2026
2 checks passed
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