Skip to content

Context Injection Breaks Prompt Cache #3

@Whamp

Description

@Whamp

I wanted to understand your design decision to inject context at every turn here: https://github.com/jo-inc/pi-mem?tab=readme-ov-file#context-injection. Maybe injecting once at the beginning is enough and state throughout a session can be handled by the model or a skill?

As i understand it many of the files being injected are likely or at least possible to be updated throughout a session. Unfortunately this will break prompt cache if a mutated result from the conversation history is sent back. This can get expensive and also get subscription users banned. I understand the desire to do it though so i wanted to see if you addressed this in a way that isn't obvious to me in the code to avoid the caching issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions