---
title: "Entity Extraction"
description: "Entity Extraction powers the automated parsing and linking of structured knowledge units from unstructured conversation text and agent interaction episodes. By combining natural language processing..."
last_updated: "2026-10-11T17:37:10.294005+00:00"
canonical_url: "https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/entity-extraction"
---

<details>
<summary>Relevant source files</summary>

The following files were used as context for generating this wiki page:

- [mem0/memory/main.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/memory/main.py)
- [mem0/utils/entity_extraction.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py)
- [mem0-ts/src/oss/src/memory/index.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0-ts/src/oss/src/memory/index.ts)
- [mem0-ts/src/oss/src/utils/entity_extraction.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0-ts/src/oss/src/utils/entity_extraction.ts)
- [integrations/mem0-agent-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py)
- [mem0-ts/src/oss/src/prompts/index.ts](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0-ts/src/oss/src/prompts/index.ts)
- [integrations/antigravity-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/antigravity-plugin/core/memory_core.py)
- [integrations/agent-plugin-core/python/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/agent-plugin-core/python/memory_core.py)
- [mem0/configs/prompts.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/configs/prompts.py)
- [integrations/cursor-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/cursor-plugin/core/memory_core.py)
- [integrations/claude-code-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/claude-code-plugin/core/memory_core.py)
- [integrations/codex-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/codex-plugin/core/memory_core.py)
- [integrations/kimi-plugin/core/memory_core.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/kimi-plugin/core/memory_core.py)
- [integrations/hermes-plugin-mem0/__init__.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/hermes-plugin-mem0/__init__.py)
- [mem0/memory/utils.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/memory/utils.py)
- [mem0/utils/spacy_models.py](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py)
</details>

## Overview

Entity Extraction powers the automated parsing and linking of structured knowledge units from unstructured conversation text and agent interaction episodes. By combining natural language processing models, regex-based heuristic filtering, and LLM-driven fact prompting, the module isolates significant proper nouns, quoted strings, technical identifiers, and multi-word topic phrases while discarding irrelevant filler.

Sources: [mem0/utils/entity_extraction.py:1-16](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L1-L16)

This subsystem bridges raw conversational streams with semantic vector storage by deduplicating candidate spans, resolving overlapping entity boundaries, and attaching normalized records to persistent memory IDs across user and agent scopes.

Sources: [mem0/memory/main.py:1100-1115](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/memory/main.py#L1100-L1115)

## Natural Language Model Loading

### Shared Model Initialization

The engine consolidates natural language processing initialization through mem0/utils/spacy_models.py, which shares model instances between entity extraction and BM25 text processing. Two distinct pipeline configurations are maintained globally: `_nlp_full` for full pipeline tasks including named entity recognition and dependency parsing, and `_nlp_lemma` with disabled components for lightweight lemmatization.

Sources: [mem0/utils/spacy_models.py:1-15](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L1-L15)

Thread safety during model acquisition is enforced using a module-level `threading.Lock()`. If model loading fails once, subsequent calls short-circuit by returning `None` immediately via `_load_failed_full` and `_load_failed_lemma` flags without re-entering the locked block.

Sources: [mem0/utils/spacy_models.py:16-19](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L16-L19), [mem0/utils/spacy_models.py:44-55](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L44-L55), [mem0/utils/spacy_models.py:69-80](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L69-L80)

> [!NOTE]
> The spaCy model `en_core_web_sm` is automatically acquired via `spacy.cli.download` if `spacy.util.is_package` detects it missing, throwing an `ImportError` if spaCy itself is absent or a `RuntimeError` if download fails.
> Sources: [mem0/utils/spacy_models.py:21-42](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L21-L42)

### Pipeline Configuration Reference

| Function | Pipeline Components | Disabled Components | Target Use Case |
| :--- | :--- | :--- | :--- |
| `get_nlp_full()` | Default full pipeline | None | Entity extraction (`_extract_entities_from_doc`) |
| `get_nlp_lemma()` | Tokenizer, tagger, morpher, lemmatizer | `["ner", "parser"]` | BM25 text processing and lemma lookups |

Sources: [mem0/utils/spacy_models.py:44-66](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L44-L66), [mem0/utils/spacy_models.py:69-91](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L69-L91)

### Batch Processing and Fallbacks

Entity extraction workflows consume the shared loader directly within `extract_entities` and `extract_entities_batch`. When processing multiple texts, `extract_entities_batch` leverages spaCy's `nlp.pipe` iterator with a configurable `batch_size` default of 32 items. If the spaCy package is missing or model loading encounters an unrecoverable exception, both functions return empty lists (`[]` or `[[] for _ in texts]`) to let higher-level extraction pipelines proceed gracefully without crashing.

Sources: [mem0/utils/entity_extraction.py:751-772](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L751-L772), [mem0/utils/spacy_models.py:56-66](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L56-L66), [mem0/utils/spacy_models.py:81-91](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L81-L91)

> [!CAUTION]
> Disabling components like `ner` and `parser` via `disable=["ner", "parser"]` in `get_nlp_lemma()` makes that instance unsuitable for dependency parsing or named entity recognition; attempting to extract entity candidates with it will yield empty results.
> Sources: [mem0/utils/spacy_models.py:69-91](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/spacy_models.py#L69-L91)

## Candidate Entity Extraction Pipeline

### Entity Extraction Phases and Candidate Types

The entity extraction engine parses a processed spaCy document through five specialized candidate generators. Each generator appends typed candidates into a shared `_EntityCandidate` dataclass collection, tracking priority, source type, character offsets, and confidence metrics before resolution.

```mermaid
flowchart TD
    Doc["spaCy Doc / Tokens"] --> NER["_add_ner_candidates"]
    Doc --> Tech["_add_technical_identifier_candidates"]
    Doc --> Prop["_add_proper_name_candidates"]
    Doc --> Quote["_add_quoted_candidates"]
    Doc --> Topic["_add_topic_phrase_candidates"]
    
    NER --> Resolve["_resolve_candidates"]
    Tech --> Resolve
    Prop --> Resolve
    Quote --> Resolve
    Topic --> Resolve
```

Sources: [mem0/utils/entity_extraction.py:24-33](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L24-L33), [mem0/utils/entity_extraction.py:731-748](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L731-L748)

The engine yields four distinct entity types categorized during parsing: `PROPER`, `QUOTED`, `TOPIC`, and `IDENTIFIER`.

Sources: [mem0/utils/entity_extraction.py:13-15](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L13-L15)

### Recognized Entity Labels and Filters

Named Entity Recognition (NER) candidate extraction relies on explicit lists of accepted and rejected spaCy entity labels. Accepted labels cover standard named entities while excluding numerical, temporal, and monetary categories.

| Label Category | Included Entity Labels |
| :--- | :--- |
| `_ACCEPTED_NER_LABELS` | `PERSON`, `ORG`, `GPE`, `LOC`, `FAC`, `PRODUCT`, `WORK_OF_ART`, `EVENT`, `NORP`, `LAW`, `LANGUAGE` |
| `_REJECTED_NER_LABELS` | `DATE`, `TIME`, `CARDINAL`, `ORDINAL`, `QUANTITY`, `MONEY`, `PERCENT` |

Sources: [mem0/utils/entity_extraction.py:98-122](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L98-L122)

> [!NOTE]
> Technical identifiers are matched using a regular expression pattern requiring a letter or underscore, followed by word characters or hyphens, separated by at least one dot component (`[A-Za-z_][\w-]*(?:\.[A-Za-z_][\w-]*)+`).
> Sources: [mem0/utils/entity_extraction.py:404-406](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L404-L406)

### Filtering Terminology and Formatting Markers

To prevent generic terms from polluting memory records, the pipeline consults multiple suppression sets. Single-word proper names, noun compound heads, and trailing words are filtered against predefined exclusion lists.

| Suppression Set | Sample Entries | Purpose |
| :--- | :--- | :--- |
| `_GENERIC_HEADS` | `thing`, `stuff`, `way`, `time`, `experience`, `situation`, `case`, `fact` | Prevents generic nouns from serving as entity heads |
| `_GENERIC_SINGLE_ENTITY_TERMS` | `user`, `assistant`, `agent`, `customer`, `client`, `memory`, `chat` | Rejects common role words and single-token pseudo-entities |
| `_CIRCUMSTANTIAL_MODS` | `solo`, `individual`, `team`, `group`, `joint`, `first`, `last`, `main` | Filters modifiers describing circumstance rather than content |
| `_GENERIC_ENDINGS` | `work`, `job`, `task`, `info`, `data`, `content`, `results`, `item` | Strips generic trailing words from compound token sequences |
| `_FORMATTING_MARKERS` | `*`, `-`, `+`, `•`, `–`, `—`, `#`, `##`, `###`, `**`, `__` | Markdown and formatting symbols skipped during extraction |

Sources: [mem0/utils/entity_extraction.py:35-96](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L35-L96), [mem0/utils/entity_extraction.py:124-162](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L124-L162), [mem0/utils/entity_extraction.py:283-317](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L283-L317), [mem0/utils/entity_extraction.py:353](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L353)

## Candidate Filtering and Heuristic Resolution

### Conflict Resolution and Deduplication Flow

The engine resolves overlapping and duplicate entity candidates inside the `_resolve_candidates` routine. Candidates are first normalized by their text representation and deduplicated by selecting the entry with the highest priority and confidence score. Surviving candidates are then sorted and scanned for overlapping character spans, filtering out redundant matches unless a specific multi-word topic spans across a proper noun boundary.

```mermaid
flowchart TD
    Candidates["Raw Candidates List"] --> Dedup["Normalize Text & Deduplicate by Priority/Confidence"]
    Dedup --> Sort["Sort by (priority, -confidence, -length, start)"]
    Sort --> Iter["Iterate Sorted Candidates"]
    Iter --> Check{"Spans Overlap & Not (TOPIC with space & PROPER)?"}
    Check -- Yes --> Skip["Drop Candidate"]
    Check -- No --> Accept["Append to Accepted List"]
    Accept --> FinalSort["Sort Final List by Start Offset & Priority"]
    FinalSort --> Output["Return (entity_type, text) Tuples"]
```

Sources: [mem0/utils/entity_extraction.py:708-728](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L708-L728)

> [!NOTE]
> During span overlap resolution, multi-word topic phrases (`TOPIC` with spaces) are permitted to coexist with overlapping proper noun entities (`PROPER`), whereas other overlapping span conflicts drop the lower-priority candidate.
> Sources: [mem0/utils/entity_extraction.py:719-724](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L719-L724)

### Sorting and Acceptance Criteria

Sorting keys applied during candidate resolution combine four distinct prioritization attributes. The sorting tuple `(c.priority, -c.confidence, -(c.end - c.start), c.start)` ensures that higher-priority, higher-confidence, and longer span matches take precedence during the linear overlap check.

Accepted candidates are subsequently resorted by their character start positions before output tuple generation.

```python
source
mem0/utils/entity_extraction.py:713-727
```

Sources: [mem0/utils/entity_extraction.py:713-727](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L713-L727)

> [!WARNING]
> Candidates with negative or unassigned start offsets default to index `10**9` during final position sorting, placing them at the end of the extracted sequence.
> Sources: [mem0/utils/entity_extraction.py:727](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/mem0/utils/entity_extraction.py#L727)

## Prompt Orchestration for Memory Extraction

### Additive Extraction Prompt Architecture

The TypeScript OSS package orchestrates prompt generation for memory extraction through the `generateAdditiveExtractionPrompt` builder and static prompt definitions in `mem0-ts/src/oss/src/prompts/index.ts`. The orchestration framework coordinates context sections including conversation summaries, past messages, existing memories, new conversational input, and temporal anchor points.

```mermaid
flowchart TD
    InputOptions["Options: existingMemories, newMessages, lastKMessages, dates"] --> DateSetup["Compute Current & Observation Dates"]
    DateSetup --> PushSummary["Push ## Summary"]
    PushSummary --> PushLastK["Push ## Last k Messages (Truncated)"]
    PushLastK --> PushRecent["Push ## Recently Extracted Memories ([] )"]
    PushRecent --> PushExisting["Push ## Existing Memories (JSON)"]
    PushExisting --> PushNew["Push ## New Messages"]
    PushNew --> PushDates["Push ## Observation Date & Current Date"]
    PushDates --> CheckCustom{"Custom Instructions Provided?"}
    CheckCustom -- Yes --> PushCustom["Push ## Custom Instructions"]
    CheckCustom -- No --> PushOutput["Push # Output:"]
    PushCustom --> PushOutput
    PushOutput --> FinalPrompt["Return Joined Prompt String"]
```

Sources: [mem0-ts/src/oss/src/prompts/index.ts:822-863](https://github.com/blade47/mem0-ts/blob/HEAD/src/oss/src/prompts/index.ts#L822-L863)

> [!NOTE]
> The builder function `generateAdditiveExtractionPrompt` defaults both `currentDate` and `observationDate` to today's ISO date string (`YYYY-MM-DD`) derived from `new Date().toISOString().split("T")[0]` if they are not explicitly supplied in the options parameter.
> Sources: [mem0-ts/src/oss/src/prompts/index.ts:830-832](https://github.com/blade47/mem0-ts/blob/HEAD/src/oss/src/prompts/index.ts#L830-L832)

### Conversation History Serialization and Truncation

Prior message arrays are serialized via `formatConversationHistory`, which iterates through message objects, extracts role and content attributes, and truncates individual messages exceeding `PAST_MESSAGE_TRUNCATION_LIMIT` characters.

```typescript
source
mem0-ts/src/oss/src/prompts/index.ts:791-820
```

Sources: [mem0-ts/src/oss/src/prompts/index.ts:791-820](https://github.com/blade47/mem0-ts/blob/HEAD/src/oss/src/prompts/index.ts#L791-L820)

> [!WARNING]
> The truncation constant `PAST_MESSAGE_TRUNCATION_LIMIT` is hardcoded to `300` characters; any past message content longer than 300 characters is sliced and appended with an ellipsis (`...`) before being formatted into the `## Last k Messages` section.
> Sources: [mem0-ts/src/oss/src/prompts/index.ts:791-799](https://github.com/blade47/mem0-ts/blob/HEAD/src/oss/src/prompts/index.ts#L791-L799)

## Agent Session Episode Assembly

### Episode Structure and Semantic Evidence

Coding session episodes are assembled into structured text content that incorporates task metadata, file modification lists, file read lists, observed tool outputs, and repository provenance identifiers. The episode assembly routine formats tasks, paths, commands, searches, conclusions, and outcomes into a bounded string format.
Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1619-1654](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1619-L1654)

Semantic evidence extraction processes modified paths and observed commands from the structured session data. Test and build results are deliberately filtered out of semantic evidence so that transient verification details do not steer memory extraction away from core repository knowledge.
Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1657-1673](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1657-L1673)

| Component | Content Filter | Bound Limit | Purpose |
| :--- | :--- | :--- | :--- |
| `task` | Raw string | None | Identifies the objective of the session |
| `modified_paths` | Sliced to first 50 items | 500 chars per path | Records changed files in the repository |
| `read_paths` | Sliced to first 50 items | None | Records inspected code files |
| `commands` | Sliced to last 30 items, status check | None | Captures observed execution commands |
| `searches` | Sliced to last 20 items, JSON dump | None | Captures query patterns and file searches |
| `conclusion` | Raw string | None | Summarizes the final state of the task |
| `outcome` | Raw string | None | Records success or failure description |

Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1620-1654](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1620-L1654)

> [!NOTE]
> Command logs within `build_semantic_evidence` are filtered to retain only entries where the command status equals `failed`, ensuring routine passing test executions are pruned from persistent semantic memory.
> Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1667-1669](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1667-L1669)

### Message Batching and Token Budget Enforcement

Session extraction messages are filtered to retain only `user` and `assistant` roles with non-empty content, after which semantic evidence is appended to the final assistant message or added as a new assistant record.
Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1688-1704](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1688-L1704)

Tokens are conservatively estimated via `_estimated_tokens`, which computes an ASCII-weighted byte and character length ratio without introducing a heavy tokenizer dependency.
Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1707-1710](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1707-L1710)

```mermaid
flowchart TD
    Start[Receive Messages] --> CheckBudget{Token count <= max_tokens?}
    CheckBudget -- Yes --> ReturnSingle[Return [messages]]
    CheckBudget -- No --> SplitExchanges[Group into user-led exchanges]
    SplitExchanges --> CheckUnits{Exchange tokens <= max_tokens?}
    CheckUnits -- Yes --> AddUnit[Append Exchange Unit]
    CheckUnits -- No --> SplitSubagents[Keep Subagent Assignment & Response paired]
    SplitSubagents --> CheckMessageSize{Message tokens <= max_tokens?}
    CheckMessageSize -- Yes --> AddBounded[Append Bounded Message]
    CheckMessageSize -- No --> SliceMessage[Binary search slice message content]
    SliceMessage --> AddBounded
    AddBounded --> FormBatches[Accumulate batches within token budget]
    FormBatches --> ReturnBatches[Return Batched Message Lists]
```

Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1735-1798](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1735-L1798)

> [!WARNING]
> Subagent interactions identified by `_is_agent_assignment` and `_is_agent_response` are explicitly kept paired together during token budget splitting to prevent splitting context across extraction batch boundaries.
> Sources: [integrations/mem0-agent-plugin/core/memory_core.py:1717-1727, 1756-1762](https://github.com/blade47/mem0/blob/b7ad69afda6b6ed030347c66d48a13e4de9dec08/integrations/mem0-agent-plugin/core/memory_core.py#L1717-L1727)

## Related

- [Memory Lifecycle](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/memory-lifecycle)
- [Multi-Signal Retrieval](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/python-core/multi-signal-retrieval)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/llms.txt) for all pages in this wiki.
