MemPalace/mempalace · error · ValueError

since ({since!r}) must be earlier than before ({before!r})

Error message

since ({since!r}) must be earlier than before ({before!r})

What it means

Error "since ({since!r}) must be earlier than before ({before!r})" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/mcp_server.py:3576

    Optional ``since`` / ``before`` filter by drawer ``filed_at`` (ISO date or
    timestamp): ``since`` is inclusive, ``before`` is exclusive (#1128). A
    drawer whose ``filed_at`` is missing or unparseable is excluded while a
    date bound is active. The filter is applied in Python after the rows are
    fetched — ChromaDB rejects string operands for ``$gte``/``$lt`` (1.5.7),
    and ``filed_at`` is stored as an ISO string, so a server-side ``where``
    comparison is not available.
    """
    limit = max(1, min(limit, _MAX_RESULTS))
    offset = max(0, offset)

    try:
        wing = _sanitize_optional_name(wing, "wing")
        room = _sanitize_optional_name(room, "room")
        since_dt = _parse_date_filter(since, "since")
        before_dt = _parse_date_filter(before, "before")
        if since_dt is not None and before_dt is not None and since_dt >= before_dt:
            raise ValueError(f"since ({since!r}) must be earlier than before ({before!r})")
    except ValueError as e:
        return {"error": str(e)}

    col = _get_collection()
    if not col:
        return _collection_error_or_no_palace()

    try:
        where = None
        conditions = []

        if wing:
            conditions.append({"wing": wing})
        if room:
            conditions.append({"room": room})

        if len(conditions) == 1:
            where = conditions[0]

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Pass a `since` value earlier than the `before` value

When it happens

Trigger: Thrown at mempalace/mcp_server.py:3576 when the library encounters an invalid state.

Common situations: Date-window arguments were given in inverted order.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/798241734ddbb8a7. Report an issue: GitHub.