> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory Search • AI Agent SDK

> memory_search: Emit memory search event for tracking memory reads.

# memory\_search

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ContextTraceEmitter**](../classes/ContextTraceEmitter) class in the [**context\_events**](../modules/context_events) module.

Emit memory search event for tracking memory reads.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def memory_search(agent_name: str, query: str, result_count: int, memory_type: str, top_score: Optional[float]) -> None
```

## Parameters

<ParamField query="agent_name" type="str" required={true}>
  Name of the agent searching memory
</ParamField>

<ParamField query="query" type="str" required={true}>
  Search query
</ParamField>

<ParamField query="result_count" type="int" required={true}>
  Number of results returned
</ParamField>

<ParamField query="memory_type" type="str" required={true}>
  Type of memory searched
</ParamField>

<ParamField query="top_score" type="Optional[float]" required={false}>
  Score of top result (if available)
</ParamField>

## Uses

* `ContextEvent`
* `time.time`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/trace/context_events.py#L839">
  `praisonaiagents/trace/context_events.py` at line 839
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Memory Concept" icon="brain" href="/docs/docs/concepts/memory" />

  <Card title="Memory Overview" icon="database" href="/docs/docs/memory/overview" />

  <Card title="Memory Configuration" icon="gear" href="/docs/docs/configuration/memory-config" />

  <Card title="Session Resume" icon="rotate-right" href="/docs/docs/memory/session-resume" />
</CardGroup>
