> ## Content Index
> Fetch the complete content index at: https://blog.getzep.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Build Better Context Graphs: Custom Instructions, Search Filters, and Webhooks
- URL: https://blog.getzep.com/build-better-context-graphs-custom-instructions-search-filters-and-webhooks/
- Published: 2026-03-03T16:25:52.000Z
- Updated: 2026-06-03T19:38:31.000Z
- Description: Custom extraction instructions, property-level search filters, exclusion filters, and webhooks — more control over how you build and query context graphs.
- Author: Jack Ryan
- Tags: product-update, context-engineering, context-graphs

We've shipped a lot over the past few months. This week: everything new in how you build and query context graphs.

## [Custom Extraction Instructions](https://help.getzep.com/custom-instructions?ref=blog.getzep.com)

Every domain has terminology that general-purpose NLP gets wrong. In legal contexts, "party" means a person or organization in an agreement — not a social event. In healthcare, "contraindication" has a precise clinical meaning. In financial services, "consideration" is a contractual concept, not an act of thinking.

Without domain guidance, Zep's extraction logic may misclassify entities or miss domain-specific relationships. Custom extraction instructions fix this.

Describe your domain — its terminology, acronyms, conventions — and Zep adapts its extraction logic to interpret your data correctly. Instructions are applied automatically in the background whenever data is ingested. No changes needed at ingestion or retrieval time.

```python
from zep_cloud.client import Zep
from zep_cloud import CustomInstruction

client = Zep(api_key=API_KEY)

client.graph.add_custom_instructions(
    instructions=[
        CustomInstruction(
            name="legal_domain",
            text=(
                "This application operates in the legal domain. "
                "A 'party' refers to a person or organization in a legal agreement. "
                "'Consideration' refers to something of value exchanged "
                "between parties in a contract. "
                "'Force majeure' refers to unforeseeable circumstances "
                "preventing contract fulfillment."
            )
        )
    ]
)

```

Instructions can be scoped project-wide or to specific users and graphs. Adding an instruction with an existing name updates it (upsert behavior). Graph-specific instructions take precedence over project-wide defaults.

This is distinct from [custom ontology](https://help.getzep.com/customizing-context?ref=blog.getzep.com), which defines the *types* of entities and relationships in your graph (e.g., a `Restaurant` entity with a `cuisine_type` attribute). Custom instructions describe the *domain itself* so Zep interprets data correctly during extraction. Use both together for the most precise context graphs.

Custom extraction instructions are available on Enterprise and Flex+ plans. [Read the docs →](https://help.getzep.com/custom-instructions?ref=blog.getzep.com)

## Graph Search Upgrades

Two new filters for more precise retrieval from your context graphs.

### [Property Filters](https://help.getzep.com/searching-the-graph?ref=blog.getzep.com#property-filtering)

Filter search results by custom attribute values on nodes and edges. If you've defined custom entity types with attributes — say, a `department` on a Person entity or a `priority` on a task — you can now filter search results by those values directly.

Supported operators: `=`, `<>`, `>`, `<`, `>=`, `<=`, `IS NULL`, `IS NOT NULL`.

```python
from zep_cloud.client import Zep
from zep_cloud.types import SearchFilters, PropertyFilter

client = Zep(api_key=API_KEY)

results = client.graph.search(
    user_id=user_id,
    query="team members",
    scope="edges",
    search_filters=SearchFilters(
        property_filters=[
            PropertyFilter(
                comparison_operator="=",
                property_name="department",
                property_value="Engineering"
            ),
            PropertyFilter(
                comparison_operator=">",
                property_name="level",
                property_value=3
            )
        ]
    )
)

```

### [Exclusion Filters](https://help.getzep.com/searching-the-graph?ref=blog.getzep.com#exclusion-filters)

New `exclude_node_labels` and `exclude_edge_types` parameters let you remove specific entity or relationship types from search results. Useful when you know certain types add noise to a particular query. Combine with inclusion filters for precise control over what comes back.

```python
results = client.graph.search(
    user_id=user_id,
    query="project information",
    scope="nodes",
    search_filters={
        "node_labels": ["Person", "Organization"],
        "exclude_edge_types": ["LOCATED_AT", "OCCURRED_AT"]
    }
)

```

[Full search documentation →](https://help.getzep.com/searching-the-graph?ref=blog.getzep.com)

## Webhooks

Polling for completion status doesn't scale when you're wiring Zep into a data pipeline. Webhooks notify you when processing finishes so you can trigger downstream work automatically.

Supported events:

- `episode.processed` — fires when an episode finishes processing and enters the context graph
- `ingest.batch.completed` — fires when a batch ingestion job completes, with episode UUIDs
- `byom.rate_limited` / `byom.request_failed` — fires when your custom LLM credentials hit rate limits or errors

Configure webhooks through the Zep dashboard: specify your HTTPS endpoint, select the events you want, and Zep sends signed HTTP POST requests you can verify with the included [Svix](https://www.svix.com/?ref=blog.getzep.com) integration. BYOM events are aggregated over 60-second windows to prevent webhook spam during error bursts.

Available on Enterprise and Flex+ plans. [Read the docs →](https://help.getzep.com/webhooks?ref=blog.getzep.com)

## Other Updates

**Flex+ Plan** — A new tier between Flex and Enterprise. Flex+ includes webhooks, custom extraction instructions, and custom entity types — without requiring an enterprise contract. If you need these capabilities but aren't ready for an enterprise commitment, Flex+ is designed for you. [See pricing →](https://www.getzep.com/pricing?ref=blog.getzep.com)

- [**Fact Triple Enhancements**](https://help.getzep.com/adding-fact-triplets?ref=blog.getzep.com#advanced-options) — Specify triple types when adding facts programmatically, with increased character limits for fact text
- [**Task Management API**](https://help.getzep.com/check-data-ingestion-status?ref=blog.getzep.com#checking-operation-status-with-task-polling) — Track long-running async operations (graph clone, fact triple ingestion) with status polling
- **Chunking Cookbook** — A new guide for ingesting business data into context graphs ([read the guide](https://help.getzep.com/chunking-large-documents?ref=blog.getzep.com))

[Get started with Zep →](https://app.getzep.com/?ref=blog.getzep.com) | [Documentation →](https://help.getzep.com/?ref=blog.getzep.com)