Feature: Injection Depth for prompt components (depth-based insertion into conversation history) #18
Labels
No labels
audit-2025-12-03
component/api
component/commands
component/llm
component/memory
component/tick-loop
component/tools
priority
high
priority
low
status
in-progress
status
needs-info
status
needs-triage
status
on-hold
type
bug
type
documentation
type
enhancement
type
feature
type
refactor
type
test
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
blightbow/evennia_ai#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement injection depth support for prompt components, allowing content to be inserted at specific positions within the conversation history rather than before/after it.
Use Cases
post_history_instructions- "Jailbreak" prompts inserted near recent messagesCritical Constraint
Injection depth is CLAMPED to Conversation History bounds.
Assembly Model
Before (current)
After (with depth injection)
Implementation
Extend PromptComponent dataclass
Modify prompt assembly
max(0, len(history) - depth)(CLAMPED)Files to Modify
prompt_components.py- Add fields to dataclassprompt_contexts.py- Handle depth-based injectionprompt_registry.py- Support depth/order in CRUDcommands/setup/component.py- Add/depthand/orderswitchesTests
tests/test_injection_depth.pyV3 Spec Reference
The V3 character card spec defines these decorators:
@@depth N- Insert at Nth message from recent@@reverse_depth N- Count from oldest message@@position VALUE- Explicit placementWe implement the core
@@depthconcept with security constraints.