ZepClient is a Typescript class for interacting with the Zep.

Implements

  • IZepClient

Constructors

  • Constructs a new ZepClient instance.

    Parameters

    • Optional projectApiKey: string

      The project API key to use for authentication.

    • Optional baseURL: string

      Optional. The base URL of the Zep API.

    Returns ZepClient

Properties

baseURL: string = "https://api.getzep.com"
cloud: boolean = false
document: DocumentManager
headers: any
projectApiKey?: string

Methods

  • Adds a new memory to a specific session.

    Parameters

    • sessionID: string

      The ID of the session to add the memory to.

    • memory: Memory

      The memory object to add to the session.

    Returns Promise<string>

    A promise that resolves to the added memory.

  • Adds or updates a session.

    Parameters

    • session: Session

      The Session object to add or update.

    Returns Promise<Session>

    A promise that resolves to the response text from the server.

    Throws

    Will throw an error if the session is not provided.

    Throws

    Will throw an error if the session.session_id is not provided.

    Throws

    Will throw an error if the fetch request fails.

  • Deletes the memory of a specific session.

    Parameters

    • sessionID: string

      The ID of the session for which the memory should be deleted.

    Returns Promise<string>

    • Promise message indicating the memory has been deleted.
  • Constructs the full URL for an API endpoint.

    Parameters

    • endpoint: string

      The endpoint of the API.

    Returns string

    The full URL.

  • Retrieves memory for a specific session.

    Parameters

    • sessionID: string

      The ID of the session to retrieve memory for.

    • Optional lastn: number

      Optional. The number of most recent memories to retrieve.

    Returns Promise<null | Memory>

    • A promise that returns a Memory object.
  • Retrieves a session with the specified ID.

    Parameters

    • sessionId: string

      The ID of the session to retrieve.

    Returns Promise<Session>

    A promise that resolves to the Session object.

    Throws

    Will throw an error if the sessionId is not provided.

    Throws

    Will throw an error if the fetch request fails.

  • Searches memory of a specific session based on search payload provided.

    Parameters

    • sessionID: string

      ID of the session for which the memory should be searched.

    • searchPayload: MemorySearchPayload

      The search payload containing the search criteria.

    • Optional limit: number

      Optional limit on the number of search results returned.

    Returns Promise<MemorySearchResult[]>

    • Promise that resolves to array of search results.
  • Asynchronously initializes a new instance of the ZepClient class.

    Parameters

    • Optional projectApiKey: string

      Optional. The project API key to use for authentication.

    • Optional baseUrl: string

      Optional. The base URL of the Zep API. Only user for open source

    Returns Promise<ZepClient>

    A promise that resolves to a new ZepClient instance.

    Throws

    Throws an error if the server is not running.

Generated using TypeDoc