Building a Prompt
How to build a prompt that incorporates Zep's memory artifacts.
Zep’s artifacts, such as Facts and Chat History, can be included in your prompts to augment the LLM’s understanding of the conversation between the user and assistant. Typically, you’d use your LLM Provider’s Chat API and structure your prompts as a series of messages: System
, User
, Assistant
, etc.
In the above example, we’re injecting Facts relevant to the conversation into the System prompt. The recent Chat History is added to the prompt as individual User
and Assistant
messages, followed by the most recent message from the User
.
In your System
message, it can be useful to call the LLM’s attention to the artifacts you’ve provided:
We can retrieve these artifacts using Zep’s high-level Memory API
or, for more control, Zep’s Search API
.