User events in Memobase are stored as a sequence of experiences, each enriched with tags. By default, events are retrieved in chronological order, but Memobase also provides a powerful search function to find events based on a query. You can perform a semantic search to find events related to a specific topic or concept.
# To use the Python SDK, first install the package:
# pip install memobase

from memobase import MemoBaseClient

client = MemoBaseClient(project_url='YOUR_PROJECT_URL', api_key='YOUR_API_KEY')
user = client.get_user('some_user_id')

# Search for events related to the user's emotions
events = user.search_event("Anything about my emotions")
print(events)
This query will return events where the user discussed their emotions, events that were automatically tagged with an emotion tag, or events that updated profile slots related to emotion. For a detailed list of search parameters, please refer to the API documentation.

Search Event Gists

A user event is a group of user infos happened in a period of time. So when you need to search for specific facts or infos, you may need a more fine-grained search. In Memobase, we call it event_gist. event_gist is a fraction of user_event that only contains one fact, schedule, or reminder of user. So if you want to search particular things of user, without the context of other infos, you can use search_event_gist to conduct a search:
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
from memobase.core.blob import ChatBlob

client = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
u = client.get_user(UID)

events = u.search_event_gist('Car')
print(events)
For detail API, please refer to Search Event Gists.