For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PlaygroundDiscordStatusDashboardSign Up >
DocumentationSDK ReferenceGraphiti
DocumentationSDK ReferenceGraphiti
  • SDK Reference
      • PUTSet graph ontology
      • GETList graph ontology
      • POSTAdd Data
      • POSTAdd Data in batch mode
      • POSTAdd Fact Triple
      • POSTClone graph
      • POSTCreate Graph
      • GETList all graphs.
      • POSTDetect Patterns (Experimental)
      • POSTSearch Graph
      • GETGet Graph
      • DELDelete Graph
      • PATCHUpdate Graph.
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
SDK ReferenceGraph

Search Graph

POST
https://api.getzep.com/api/v2/graph/search
POST
/api/v2/graph/search
1from zep_cloud import Zep
2
3client = Zep(
4 api_key="YOUR_API_KEY",
5)
6client.graph.search(
7 query="query",
8)
1{
2 "context": "string",
3 "edges": [
4 {
5 "created_at": "string",
6 "fact": "string",
7 "name": "string",
8 "source_node_uuid": "string",
9 "target_node_uuid": "string",
10 "uuid": "string",
11 "attributes": {},
12 "episodes": [
13 "string"
14 ],
15 "expired_at": "string",
16 "invalid_at": "string",
17 "relevance": 1.1,
18 "scope": "string",
19 "score": 1.1,
20 "selection_rank": 1,
21 "valid_at": "string"
22 }
23 ],
24 "episodes": [
25 {
26 "content": "string",
27 "created_at": "string",
28 "uuid": "string",
29 "metadata": {},
30 "processed": true,
31 "relevance": 1.1,
32 "role": "string",
33 "role_type": "norole",
34 "score": 1.1,
35 "selection_rank": 1,
36 "source": "text",
37 "source_description": "string",
38 "task_id": "string",
39 "thread_id": "string"
40 }
41 ],
42 "nodes": [
43 {
44 "created_at": "string",
45 "name": "string",
46 "summary": "string",
47 "uuid": "string",
48 "attributes": {},
49 "labels": [
50 "string"
51 ],
52 "relevance": 1.1,
53 "score": 1.1,
54 "selection_rank": 1
55 }
56 ],
57 "observations": [
58 {
59 "created_at": "string",
60 "name": "string",
61 "uuid": "string",
62 "attributes": {},
63 "end_at": "string",
64 "episode_ids": [
65 "string"
66 ],
67 "labels": [
68 "string"
69 ],
70 "latest_evidence_at": "string",
71 "relevance": 1.1,
72 "score": 1.1,
73 "selection_rank": 1,
74 "start_at": "string",
75 "summary": "string"
76 }
77 ],
78 "response": {
79 "server_latency_ms": 1
80 },
81 "thread_summaries": [
82 {
83 "created_at": "string",
84 "name": "string",
85 "uuid": "string",
86 "labels": [
87 "string"
88 ],
89 "last_summarized_at": "string",
90 "last_summarized_episode_valid_at": "string",
91 "relevance": 1.1,
92 "score": 1.1,
93 "selection_rank": 1,
94 "summary": "string"
95 }
96 ]
97}
Perform a graph search query.
Was this page helpful?
Previous

Get Graph

Next
Built with

Request

Graph search query
querystringRequired<=400 characters

The string to search for (required)

bfs_origin_node_uuidslist of stringsOptional
Nodes that are the origins of the BFS searches
center_node_uuidstringOptional
Node to rerank around for node distance reranking
graph_idstringOptional

The graph_id to search in. When searching user graph, please use user_id instead.

limitintegerOptional<=50

The maximum number of facts to retrieve for non-auto scopes. Defaults to 10. Limited to 50. Ignored when scope=auto.

max_charactersintegerOptional1-50000

Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000.

mmr_lambdadoubleOptional
weighting for maximal marginal relevance
rerankerenumOptional

Defaults to RRF. Ignored when scope=auto except node_distance and episode_mentions are rejected; auto search always uses RRF retrieval and applies its own internal rerank after retrieval.

Allowed values:
return_raw_resultsbooleanOptional

When scope=auto, include the selected raw graph results alongside the materialized context block. For graph-service-backed auto mode, selected raw results may include episodes, edges, nodes, observations, and thread_summaries.

scopeenumOptional
Defaults to Edges.
search_filtersobjectOptional
Search filters to apply to the search
user_idstringOptional

The user_id when searching user graph. If not searching user graph, please use graph_id instead.

Response

Graph search results or auto-context block

contextstring
edgeslist of objects
episodeslist of objects
nodeslist of objects
observationslist of objects
responseobject
thread_summarieslist of objects

Errors

400
Bad Request Error
500
Internal Server Error