Skip to content

Harden KnowledgePack retrieval and redacted PromptTrace #136

@JOY

Description

@JOY

Summary

Make NPC context compact, inspectable, and safe before expanding more dialogue features.

Scope

  • Keep zone, profession, faction, quest, and private memory context as tagged KnowledgePacks.
  • Retrieve only compact relevant packs per decision.
  • Store redacted PromptTrace metadata: identity version, memory ids, relationship ids, knowledge pack ids, objective id, source, latency, fallback reason, and validation result.
  • Avoid storing raw secrets or full prompts by default.

Acceptance Criteria

  • PromptTrace can explain which context components shaped a decision without storing raw provider prompt text.
  • KnowledgePack selection is bounded and relevance-scored beyond fixed MVP selectors.
  • Unity debug UI can show PromptTrace summaries for the selected NPC.
  • Tests cover prompt trace redaction, context caps, and missing pack fallback.

References

  • docs/design/26-ai-npc-backend-client-roadmap.md
  • docs/design/16-npc-society-multi-agent-architecture.md
  • docs/design/25-ai-npc-research-anchor-map.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ai-agentOffline player agent, NPC intelligence, and agent observabilityarea:nakamaNakama runtime, storage, auth, social, or backend modulesenhancementNew feature or requestpriority:p2Important but not blocking current milestonesize:mMedium task

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions