Skip to content

Redesign Qwestor action selection with adaptive context filtering and added evaluation#20

Merged
Nahom32 merged 4 commits into
iCog-Labs-Dev:mainfrom
Mahider-n:feat/eval-metrics
Jul 7, 2026
Merged

Redesign Qwestor action selection with adaptive context filtering and added evaluation#20
Nahom32 merged 4 commits into
iCog-Labs-Dev:mainfrom
Mahider-n:feat/eval-metrics

Conversation

@Mahider-n

@Mahider-n Mahider-n commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This PR redesigns Qwestor's decision-making pipeline to make action selection more context-sensitive.
The changes introduce adaptive candidate filtering, recalibrated action definitions, redesigned stimulus generation, anti-goal-aware risk estimation, and improved evaluation logging.

Changes

Context Parser

  • Updated the context parser to use a new LLM model.
  • Added comprehensive docstrings for context parser functions to improve maintainability and readability.

Utilities

  • Added helper functions for retrieving anti-goal values from the motivation space.
  • Added corresponding unit tests.

Stimulus Adapter

Redesigned the context-to-stimulus mapping.

Instead of relying almost entirely on linear signal weighting, the new implementation adopts a hybrid linear and rule-based approach.

Changes include:

  • Reduced continuous weights for several context signals.
  • Added threshold-based boosts and penalties for high-impact signals, including:
    • verification requests
    • high ambiguity
    • planning requirements
    • external evidence requirements
  • Increased decisiveness for context-specific actions while preserving continuous signal contributions.

Action Selection

The action layer was redesigned to become context adaptive rather than treating every action as a static candidate.

Changes include:

  • Recalibrated action definitions to better reflect their intended cognitive roles described in the Qwestor paper.
  • Redesigned base risk estimates for each action.
  • Integrated anti-goal exposure into action risk estimation.
  • Added anti-goal exposure mappings for every action.
  • Introduced context-driven candidate filtering so only relevant actions are evaluated by MAGUS.

Previously, MAGUS evaluated all available actions regardless of context. The new implementation forwards only contextually relevant candidates, reducing unnecessary competition between unrelated actions while making action selection more computationally efficient and cognitively plausible.

State Projection

  • Updated the state bridge to support the redesigned action evaluation pipeline.

Evaluation Pipeline

Enhanced evaluation logging by storing additional information for every interaction, including:

  • parsed context
  • generated stimulus

This makes it possible to evaluate whether selected actions are consistent with both the environmental context and the internal motivational state.

Session & Infrastructure

  • Updated session helpers and session storage to support the new evaluation data.
  • Added evaluation and metrics modules.
  • Added and updated tests across the affected modules.

Technical Approach

The overall architecture shifts from a static action-selection process toward an adaptive pipeline:

  1. Parse user context.
  2. Generate a context-sensitive stimulus using hybrid weighting and threshold rules.
  3. Dynamically filter candidate actions based on context.
  4. Adjust action risks according to the current anti-goal state.
  5. Forward only relevant candidates to MAGUS for evaluation.
  6. Persist context and stimulus alongside evaluation results for downstream analysis.

Comment thread usecase/adapters/tests/qwestor_actions_test.metta
Comment thread usecase/adapters/qwestor_actions.metta
Comment thread usecase/utils.metta Outdated
@Nahom32 Nahom32 merged commit c2950a5 into iCog-Labs-Dev:main Jul 7, 2026
1 check 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