Customer and account context

Combine records, conversations, and events for each customer or account

An agent cannot understand a customer’s situation when account records, conversations, and events are separate. Zep can combine these sources into Context Graphs that preserve the correct user, customer, or account scope.

Choose the graph model

Use the graph scope that matches data ownership and access:

ContextRecommended scope
A person’s conversations, activity, and preferencesA user graph addressed with user_id
Shared account records, cases, contracts, or organization eventsA Context Graph addressed with graph_id
A task that needs personal and account contextRetrieve from the user graph and the authorized account graph

Do not copy shared account data into every user graph. Keep shared data in an account Context Graph and retrieve it only for authorized callers.

Implementation path

1

Create users for personal context

Create a Zep user for each application user whose conversations or activity must persist.

2

Create a Context Graph for shared account context

Create a graph with a stable graph_id for the customer or account.

3

Ingest each source into the correct graph

Add conversations through threads. Add user-owned business data with user_id. Add shared records and events with the account graph_id.

4

Retrieve the context required for the task

Use thread.get_user_context for the user context. Use graph.search for account context, and combine the results in the application.

5

Apply access controls and preserve provenance

Use policy-based access control for shared graphs. Retain source episode references when the application must show where a retrieved fact came from.

See Add User-Specific Business Data and Share Context Across Users for implementation examples.

Application responsibilities

Zep controls access to context in Zep. Your application remains responsible for customer authorization, action permissions, model instructions, and the validation of changes in external systems.