Skip to content

Commit 8038d30

Browse files
committed
fix: search api error (#137)
1 parent de0e037 commit 8038d30

File tree

2 files changed

+3999
-4000
lines changed

2 files changed

+3999
-4000
lines changed

docs/site/features/event/event_search.mdx

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,8 @@ title: Searching Events
33
---
44

55
User events in Memobase are stored as a sequence of experiences, each enriched with [tags](/features/event/event_tag). By default, events are retrieved in chronological order, but Memobase also provides a powerful search function to find events based on a query.
6-
76
## Semantic Search
87

9-
You can perform a semantic search to find events related to a specific topic or concept.
10-
11-
```python
12-
# To use the Python SDK, first install the package:
13-
# pip install memobase
14-
15-
from memobase import MemoBaseClient
16-
17-
client = MemoBaseClient(project_url='YOUR_PROJECT_URL', api_key='YOUR_API_KEY')
18-
user = client.get_user('some_user_id')
19-
20-
# Search for events related to the user's emotions
21-
events = user.search_event("Anything about my emotions")
22-
print(events)
23-
```
24-
25-
This query will return events where the user discussed their emotions, events that were automatically [tagged](/features/event/event_tag) with an `emotion` tag, or events that updated profile slots related to emotion.
26-
27-
For a detailed list of search parameters, please refer to the [API documentation](/api-reference/events/search_events).
28-
29-
## Search Event Gists
30-
318
A user event is a group of user infos happened in a period of time.
329
So when you need to search for specific facts or infos, you may need a more fine-grained search.
3310

@@ -55,4 +32,30 @@ print(events)
5532
```
5633
</CodeGroup>
5734

58-
For detail API, please refer to [Search Event Gists](/api-reference/events/search_event_gists).
35+
For detail API, please refer to [Search Event Gists](/api-reference/events/search_event_gists).
36+
37+
## Search Packed Events with Tags
38+
39+
You can perform a semantic search to find events related to a specific topic or concept.
40+
41+
Different from `search_event_gist`, the return elements of `search_event` are packed gists of user events(happened in a period of time).
42+
43+
We recommend more to use `search_event_gist` to retrieve fine-grained events.
44+
45+
```python
46+
# To use the Python SDK, first install the package:
47+
# pip install memobase
48+
49+
from memobase import MemoBaseClient
50+
51+
client = MemoBaseClient(project_url='YOUR_PROJECT_URL', api_key='YOUR_API_KEY')
52+
user = client.get_user('some_user_id')
53+
54+
# Search for events related to the user's emotions
55+
events = user.search_event("Anything about my emotions")
56+
print(events)
57+
```
58+
59+
This query will return events where the user discussed their emotions, events that were automatically [tagged](/features/event/event_tag) with an `emotion` tag, or events that updated profile slots related to emotion.
60+
61+
For a detailed list of search parameters, please refer to the [API documentation](/api-reference/events/search_events).

0 commit comments

Comments
 (0)