Skip to content

[BUG] empty-result bug in episode_fulltext_search #801

@lissxxxx

Description

@lissxxxx

Bug Description

When calling episode_fulltext_search with no group_ids (or an empty list), the query always returns an empty list.

Steps to Reproduce

Provide a minimal code example that reproduces the issue:

    config = COMBINED_HYBRID_SEARCH_CROSS_ENCODER.model_copy(deep=True)
    config.limit = 10
    config.reranker_min_score = 0.0

    results = await graphiti._search("something", config=config)

Expected Behavior

When group_ids is None or an empty list, the search should behave like the other fulltext functions and return matching episodes regardless of group, i.e. skip the group_id filter entirely.

Actual Behavior

The query includes:

WHERE e.uuid = episode.uuid
  AND e.group_id IN $group_ids

with $group_ids = NULL (or []), which makes the IN check always false. As a result, episode_fulltext_search returns [].

Environment

  • Graphiti Version: 0.18.1
  • Python Version: 3.10.12
  • Operating System: Ubuntu 22.04.5 LTS
  • Database Backend: Neo4j 5.26.2
  • LLM Provider & Model: OpenAI gpt-4.1-mini/nano

Installation Method

  • pip install
  • uv add
  • Development installation (git clone)

Error Messages/Traceback

nothing

Configuration

nothing

Additional Context

  • Does this happen consistently or intermittently?
    • consistently
  • Which component are you using? (core library, REST server, MCP server)
    • core library
  • Any recent changes to your environment?
    • Update 0.18.1 from 0.15.1
  • Related issues or similar problems you've encountered?
    • No

Possible Solution

If delete below code, it works,

        AND e.group_id IN $group_ids

https://github.com/getzep/graphiti/blob/main/graphiti_core/search/search_utils.py#L458

Either modify it as shown below, or apply another fix.

WHERE e.uuid = episode.uuid
  AND (
    size(coalesce($group_ids, [])) = 0
    OR e.group_id IN $group_ids
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions