The Lifecycle of a Turn

A visual journey of data through the engine, step-by-step.

This guide traces the journey of a single user input (e.g., "The cat eats") through the BSP engine, from raw text to the final response and state update.

The Flow at a Glance

sequenceDiagram participant U as User participant T as Tokenizer participant L as Learner participant GS as GroupStore participant DG as DeductionGraph participant SM as SequenceModel U->>T: "The cat eats" T->>L: Token IDs: [12, 45, 99] rect rgb(240, 248, 255) note right of L: 1. ACTIVATION L->>GS: Query Index([12, 45, 99]) GS-->>L: Candidates Groups L->>L: Score & Select (Top-K) L-->>GS: Update "Active Groups" end rect rgb(255, 240, 245) note right of L: 2. PREDICTION L->>DG: Predict Next(Active Groups) DG-->>L: Predicted Concept IDs end rect rgb(240, 255, 240) note right of L: 3. GENERATION L->>SM: Generate(Predicted Concepts) SM-->>U: "fish" (Response) end rect rgb(255, 250, 205) note right of L: 4. LEARNING L->>L: Compute Surprise L->>GS: Update Memberships L->>DG: Update Deduction Links end

Step-by-Step Walkthrough

Step 1: Input & Tokenization (The Eyes)

Input: "The cat eats"

The Tokenizer breaks this down. It doesn't use embeddings. It maps strings to deterministic Integers.

Result: A Bitset representing {12, 45, 99}.

Step 2: Activation (The Recognition)

The Learner asks the GroupStore: "Who cares about these tokens?"

  1. It checks the Inverted Index.
  2. It finds Group #5 (which contains {cat, dog, pet}) and Group #20 (which contains {eats, drinks}).
  3. It calculates Jaccard Similarity. Group #5 has 1 match ("cat") out of 3 members. Score: 0.33.

Result: Active Groups = [Group #5, Group #20].

Step 3: Deduction (The Thought)

The DeductionGraph looks at the active groups. It contains learned temporal links.

Step 4: Sequence Generation (The Speech)

The engine now has a bag of predicted concepts (from Group #99: {food, fish, dry, bowl}).

The SequenceModel (a smart n-gram graph) constructs a sentence.

  1. It sees the user ended with "eats".
  2. It knows "eats" is often followed by "food" or "fish".
  3. It selects "fish" because Group #99 boosted its score.

Output: "fish"

Step 5: Learning (The Update)

Once the turn is done (or if we have ground truth), the system learns.