Skip to content

feat: trace the Memory read path #1241

Description

@PsiACE

Feature description

Add bounded tracing for Memory search, reranking, and context preparation.

Problem and proposed solution

search_memory and prepare_context currently expose only the outer application span. Add enough detail to show which read stage ran, how many candidates were handled, and where latency or failure occurred.

Possible trace structure:

powercontext search_memory
└── memory.search
    ├── embeddings <model>
    └── memory.rerank
        └── invoke_agent memory_rerank

powercontext prepare_context
├── memory.search
├── experience.search
└── context.prepare

Do not record queries, prompts, Memory content, or vectors.

The PR should include an exported span tree or dashboard screenshot.

Alternatives considered

Keep the existing application span only.

Additional context

Part of #1214. Tracing remains optional and must not change Runtime behavior.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions