Skip to content

search_event returns KeyError 'events' #137

@kun432

Description

@kun432

Description

search_event returns KeyError 'events'.

Steps to reproduce

from memobase import MemoBaseClient

client = MemoBaseClient(
    project_url="http://MY_SERVER:8019",
    api_key="secret",
)

uid = client.add_user({"name": "test"})
u = client.get_user(uid)
from memobase import ChatBlob

b = ChatBlob(
    messages=[
        { "role": "user", "content": "Hi! I'm Alex, originally from Canada and now living in Portland. I'm thinking about getting into home coffee roasting—mind giving me a quick starter plan?" },
        { "role": "assistant", "content": "Happy to help! Do you prefer a super simple setup (popcorn popper) or a more controlled entry-level roaster with temperature profiling?" },
        { "role": "user", "content": "Let's start simple. I work from home most days, so I can roast on my balcony on Saturday mornings." },
        { "role": "assistant", "content": "Great. Starter kit: an air popcorn popper dedicated to coffee, a basic digital scale, a metal sieve for cooling, and a timer. Aim for 70–90 grams per batch to keep it even." },
        { "role": "user", "content": "Nice. I like medium roasts for pour-over. Any beginner-friendly beans to order?" },
        { "role": "assistant", "content": "Try a washed Colombia or Ethiopia for clarity, or a Guatemala for balanced sweetness. Start with 1 kg so you can iterate. Store green beans in a cool, dry place." },
        { "role": "user", "content": "Cool. By the way, I'm starting a new data role on Oct 21, so I want something low-maintenance on weekdays. Weekends I also hike in the Columbia River Gorge." },
        { "role": "assistant", "content": "Congrats on the new role! Weekday plan: pre-weigh doses on Sunday night, and use a simple 1:16 brew ratio with a 3–3.5 min total time. For hikes, pack a small grinder and single-serve filters—lightweight and mess-free." },
        { "role": "user", "content": "I’m planning a hike this Sunday—Dog Mountain if the weather holds. Any tips for coffee + hike logistics?" },
        { "role": "assistant", "content": "Roast on Saturday morning, let beans rest 12–24 hours. On Sunday, bring 20–22 g per cup in small zip bags, a collapsible filter cone, and a 500 ml insulated bottle of hot water. Keep gear together in a dry bag; enjoy a medium roast Colombia for a clean cup with views!" }
    ]
)
u.insert(b)
u.flush()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[9], line 1
----> 1 u.search_event("about coffee")

File [/opt/conda/lib/python3.12/site-packages/memobase/core/entry.py:297](http://localhost:8888/opt/conda/lib/python3.12/site-packages/memobase/core/entry.py#line=296), in User.search_event(self, query, topk, similarity_threshold, time_range_in_days)
    291 params = f"?query={query}&topk={topk}&similarity_threshold={similarity_threshold}&time_range_in_days={time_range_in_days}"
    292 r = unpack_response(
    293     self.project_client.client.get(
    294         f"[/users/event/search/](http://localhost:8888/users/event/search/){self.user_id}{params}"
    295     )
    296 )
--> 297 return [UserEventData.model_validate(e) for e in r.data["events"]]

KeyError: 'events'

Additional Info

get context: OK

print(u.context())
---
# Memory
Unless the user has relevant queries, do not actively mention those memories in the conversation.
## User Current Profile:
- basic_info::name: Alex
- basic_info::nationality: Canada
- contact_info::city: Portland
- work::title: data role
- work::working_industry: data
- work::previous_projects: starting a new data role on October 21, 2025 [mention 2025/09/30, start job in 2025/10/21]
- interest::hobbies: plans to roast coffee on Saturday mornings [mention 2025/09/30, roast coffee in 2025/10/07]; plans to hike in the Columbia River Gorge on weekends
- life_event::hiking: planning a hike to Dog Mountain this Sunday if the weather holds [mention 2025/09/30, plan hike in 2025/10/01]

## Past Events:
- User's alias is Alex. // info
- Alex is originally from Canada and now living in Portland. // info
- Alex works from home most days. // info
- Alex is starting a new data role on October 21, 2025. [mention 2025/09/30, start job in 2025/10/21] // info
- Alex plans to roast coffee on Saturday mornings. [mention 2025/09/30, roast coffee in 2025/10/07] // schedule
- Alex plans to hike in the Columbia River Gorge on weekends. // schedule
- Alex is planning a hike to Dog Mountain this Sunday if the weather holds. [mention 2025/09/30, plan hike in 2025/10/01] // schedule
---

search event gist: OK

u.search_event_gist("about coffee")
[UserEventGistData(id=UUID('1a75b15a-ae36-4ea4-8c4a-025886b3de28'), gist_data=EventGistData(content='- Alex plans to roast coffee on Saturday mornings. [mention 2025/09/30, roast coffee in 2025/10/07] // schedule'), created_at=datetime.datetime(2025, 9, 29, 17, 44, 41, 295587, tzinfo=TzInfo(UTC)), updated_at=datetime.datetime(2025, 9, 29, 17, 44, 41, 295587, tzinfo=TzInfo(UTC)), similarity=0.47585159684112177)]

only search event fails.

Environments

  • Memobase PyPI: 0.0.25 (on JupyterLab)
  • Memobase Server: 0.0.40 (on Ubuntu-22.04 / Docker-28.3.1 / commit: c76b4fd)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions