feat(soul): context quality, first-message profile load, refusal handling, agentic safety #33

Closed
will.anderson wants to merge 0 commits from improve/soul-chat-pipeline into main
Owner

Improve engram context assembly, load user profile on session start, improve capability-gap responses, add safety check to agentic path.

Improve engram context assembly, load user profile on session start, improve capability-gap responses, add safety check to agentic path.
will.anderson added 1 commit 2026-06-22 16:22:55 +00:00
- engram_compile: rank search results by recency x relevance before including
  in context. Pulls 20 candidates, scores each (salience * importance * recency
  decay), keeps top 8. Eliminates stale/low-signal nodes that diluted context.

- handle_chat: on hist_len==0 (session start), proactively load user profile
  and active-work context from engram and inject as brief bullets in the system
  prompt. Gives the soul grounding before any conversation history exists.

- build_system_prompt: add [CAPABILITY GAPS] directive instructing the soul to
  offer partial help and reasoning instead of flat "I don't have access to that"
  refusals when a tool is missing.

- handle_chat_agentic: run safety_screen at entry, mirroring layered_cycle.
  Hard bell exits immediately with the crisis response without entering the loop.

- agentic_loop: surface the 8-iteration cap explicitly in the error envelope
  ("agentic loop hit the 8-iteration cap...") rather than the opaque "no response".
  Add iterations count to both the error and success envelopes for observability.
will.anderson closed this pull request 2026-06-22 16:39:59 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron#33