fix(zep): normalize bare YYYY-MM-DD createdAt to ISO 8601#41
Open
ShabanShaame wants to merge 1 commit into
Open
fix(zep): normalize bare YYYY-MM-DD createdAt to ISO 8601#41ShabanShaame wants to merge 1 commit into
ShabanShaame wants to merge 1 commit into
Conversation
Zep Cloud's /api/v2/graph-batch endpoint rejects bare date strings
(e.g. "2025-01-03") with a misleading "400 invalid json" error,
even though the payload is valid JSON. Datasets that store dates
without a time component (common for daily-bucketed corpora) cannot
be ingested as a result.
Normalize bare YYYY-MM-DD values to midnight UTC before building
the episode; full ISO strings pass through unchanged.
Discovered while running Structured Recall Bench
(github.com/everdreamsoft/structured-recall-bench), whose dataset
sessions carry metadata.date = "YYYY-MM-DD". With this fix, the full
130-question benchmark runs cleanly against Zep Cloud (composite 0.332,
ingestion ~15 min, no API errors).
Repro (minimal):
import { ZepClient } from "@getzep/zep-cloud"
const client = new ZepClient({ apiKey: process.env.ZEP_API_KEY! })
await client.graph.create({ graphId: "repro", name: "repro" })
await client.graph.addBatch({
graphId: "repro",
episodes: [{ type: "message", data: "user: hi", createdAt: "2025-01-03" }],
}) // throws BadRequestError: invalid json
Behavior table (Zep Cloud, SDK @getzep/zep-cloud, 2026-04-20):
createdAt value | Result
-------------------------|---------------------------
"2025-01-03" | 400 invalid json
"2025-01-03T00:00:00Z" | 200 OK
omitted | 200 OK (server fills now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Zep Cloud's
/api/v2/graph-batchendpoint rejects bare date strings (e.g."2025-01-03") with a misleading400 invalid jsonerror, even though the payload is valid JSON. Datasets that store dates without a time component (common for daily-bucketed corpora) cannot be ingested throughZepProvider.ingest()as a result.This patch normalizes bare
YYYY-MM-DDvalues to midnight UTC before building eachZep.EpisodeData. Full ISO strings pass through unchanged.Repro (minimal)
Behavior table
Zep Cloud, SDK
@getzep/zep-cloud, observed 2026-04-20:createdAtvalue"2025-01-03""2025-01-03T00:00:00Z"The error message is misleading — the payload is valid JSON; Zep's validator folds date-format failures into the generic "invalid json" response.
Context
Discovered while running Structured Recall Bench against the
zepprovider. SRB's dataset sessions carrymetadata.date = "YYYY-MM-DD". With this fix, the full 130-question benchmark runs cleanly against Zep Cloud (composite 0.332, ingestion ~15 min, no API errors).Test plan
memorybenchwith-p zepagainst a dataset whose sessions carry bareYYYY-MM-DDdates and confirms ingestion no longer 400s