Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] updateMessageMetadata fails on custom postgres schema due to hardcoded public.role_type_enum #388

Open
simple10 opened this issue Mar 15, 2025 · 1 comment

Comments

@simple10
Copy link

Describe the bug

Role Type enum fails when using postgres custom schema when updating message metadata..

It appears the "public" schema is hard coded in at least one place:
https://github.com/getzep/zep/blob/main/src/store/schema_common.go#L79

To Reproduce

  1. Create a custom postgres schema for zep
  2. Set schema_name to the custom schema in zep.yaml
  3. Attempt to update zep message metadata

Expected behavior

Allow for enums in custom schemas and not just public schema.

Logs

Here's the example code I'm running...

https://github.com/LLemonStack/llemonstack/blob/main/examples/zep/zep.ts#L131

Fails on await client.memory.updateMessageMetadata

All other requests seem to work in the example script. It's only updateMessageMetadata that throws an error.

Trying to update message metadata
Got error: Error: InternalServerError
Status code: 500
Body: {
  "message": "failed to update messages: ERROR: type \"public.role_type_enum\" does not exist (SQLSTATE=42704)"
}
    at Memory.<anonymous> (file:///Users/joe/Library/Caches/deno/npm/registry.npmjs.org/@getzep/zep-js/2.0.2/api/resources/memory/client/Client.js:1048:31)
    at Generator.next (<anonymous>)
    at fulfilled (file:///Users/joe/Library/Caches/deno/npm/registry.npmjs.org/@getzep/zep-js/2.0.2/api/resources/memory/client/Client.js:31:58)
    at eventLoopTick (ext:core/01_core.js:177:7) {
  statusCode: 500,
  body: {
    message: 'failed to update messages: ERROR: type "public.role_type_enum" does not exist (SQLSTATE=42704)'
  }
}

Trying to get session message
Session message:  {"uuid":"3d3c107e-9e8f-42e8-bed1-da032989cc48","createdAt":"2025-03-15T00:19:04.753595Z","updatedAt":"0001-01-01T00:00:00Z","role":"user","roleType":"user","content":"Hi there, I'm looking for a new pair of shoes. I'm not sure where to start.","tokenCount":0}

Trying to get search message
Searching memory... Name some books that are about dystopian futures.

The role_type_enum was created by zep in the custom schema: zep_schema.role_type_enum

Environment (please complete the following information):

  • Zep version: 1.0.2 CE (I think) from zepai/zep:latest docker pulled today
  • Zep SDK and version: zep-js 2.0.2
  • Deployment: local Docker

Additional context
Add any other context about the problem here.

@simple10 simple10 changed the title [BUG] [BUG] updateMessageMetadata fails on custom postgres schema due to hardcoded public.role_type_enum Mar 15, 2025
@simple10
Copy link
Author

A quick workaround is to just create an alias in posgres for public.role_type_enum to map to the custom schema:

CREATE DOMAIN public.role_type_enum AS custom_zep_schema.role_type_enum;

Where custom_zep_schema is whatever custom schema was created for zep to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant