<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zep &#8211; iAIFeed</title>
	<atom:link href="https://www.iaifeed.com/tag/zep/feed" rel="self" type="application/rss+xml" />
	<link>https://www.iaifeed.com</link>
	<description>iAIFeed</description>
	<lastBuildDate>Mon, 09 Nov 2026 12:43:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://www.iaifeed.com/wp-content/uploads/2026/07/cropped-iaifeed1-80x80.png</url>
	<title>zep &#8211; iAIFeed</title>
	<link>https://www.iaifeed.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Cut a Long-Chat Memory Bill with Zep Summaries and Search</title>
		<link>https://www.iaifeed.com/how-to-cut-a-long-chat-memory-bill-with-zep-summaries</link>
					<comments>https://www.iaifeed.com/how-to-cut-a-long-chat-memory-bill-with-zep-summaries#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Mon, 09 Nov 2026 12:43:18 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[zep]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-cut-a-long-chat-memory-bill-with-zep-summaries</guid>

					<description><![CDATA[Chat memory cost is a retrieval design problem. Where Zep summaries beat search, how continuous summaries work, and the misuse that blows a prompt budget.]]></description>
										<content:encoded><![CDATA[<p>Most teams adopting <a href="https://www.iaifeed.com/ai-tool/zep">Zep</a> for the first time send it everything and pull everything back. That is the expensive way to use it. The cheaper pattern is to decide per request whether you need a summary, a search result, or nothing at all.</p>
<p>This is the advanced half of Zep work: what the summary pipeline actually produces, which endpoint answers which question, and how to keep a memory block from quietly doubling your input tokens.</p>
<h2 id="what-does-zeps-summary-pipeline-actually-produce">What does Zep&#8217;s summary pipeline actually produce?</h2>
<p>On top of the fact graph, Zep keeps a running summary of the session. A background job compares the new turns against the existing summary and writes an updated one that references established entities, so the summary stays coherent across hundreds of turns.</p>
<p>What comes back from a summary query is a short paragraph, usually 150–250 words: what the user is trying to do, what was decided, what is still open. It is not a transcript and it does not include every fact.</p>
<p>That is a feature. A transcript in a prompt invites the model to reason about old details that no longer apply. A summary states the current position.</p>
<h2 id="when-should-you-use-search-instead-of-the-summary">When should you use search instead of the summary?</h2>
<p>Search whenever the user&#8217;s question has a <strong>specific noun</strong> in it: a ticket number, an account name, a product code. Search does keyword plus embedding retrieval across the graph and returns the matching facts with their timestamps.</p>
<p>The decision rule that has held up in practice:</p>
<ul>
<li>&#8220;What is this customer&#8217;s setup?&#8221; — summary.</li>
<li>&#8220;What did they say about invoice 88421?&#8221; — search.</li>
<li>&#8220;Remind me who they are&#8221; — summary.</li>
<li>&#8220;Anything about the migration?&#8221; — search, then summarise the hits yourself.</li>
</ul>
<p>A hybrid works too: fetch the summary as background, add three search hits for the named entity. Total comes to roughly 500 tokens and covers both cases.</p>
<h2 id="how-do-you-keep-the-memory-block-from-growing-over-time">How do you keep the memory block from growing over time?</h2>
<p>This is where most bills go sideways. The memory endpoint returns facts for the whole session by default. As a support conversation approaches 200 turns, the fact count rises into the hundreds and a single retrieval can return several thousand tokens.</p>
<p>Three controls:</p>
<ol>
<li><strong>Scope the read.</strong> Fetch memory per session, not per user, when the conversation is self-contained. User-level memory is for facts that outlive a single ticket.</li>
<li><strong>Cap search results.</strong> <code>limit=5</code> is usually enough. <code>limit=20</code> costs four times the tokens and adds maybe one useful fact.</li>
<li><strong>End sessions.</strong> Once a ticket closes, ending the session freezes its summary. New conversations start clean and the old one becomes searchable history rather than active memory.</li>
</ol>
<p>A team running 5,000 daily requests that shaved 1,200 tokens off the memory block saves almost 6 million input tokens a day. That is the whole game.</p>
<h2 id="how-does-custom-extraction-change-the-result">How does custom extraction change the result?</h2>
<p>Zep&#8217;s default extractor looks for people, organisations, projects, preferences and events. If your domain has nouns it will not classify (SKUs, lab codes, prescription names), those get stored as prose and retrieval for them degrades.</p>
<p>Custom instructions fix it. You describe the entity types and fact patterns you care about, and extraction starts emitting them as typed nodes. Two cautions: custom extraction increases cost per ingest, and a badly written instruction set will produce noisy entities that pollute search.</p>
<p>Write instructions that mirror how your users actually talk. &#8220;Track server names, regions and deployment dates&#8221; works. &#8220;Track all technical details&#8221; does not.</p>
<h2 id="what-about-latency-in-a-real-request-path">What about latency in a real request path?</h2>
<p>Ingestion is asynchronous, so it does not block the response. Retrieval is synchronous, and a memory read is typically a few tens of milliseconds against the cloud API; a graph search with an LLM reranking step is slower, sometimes several hundred milliseconds.</p>
<p>If you are on a strict sub-second budget:</p>
<ul>
<li>Read the summary in parallel with your main model call, not before it.</li>
<li>Cache the memory block per session for 60 seconds. Most users send another message within that window.</li>
<li>Skip the rerank step for trivial questions by using the summary alone.</li>
</ul>
<h2 id="how-does-this-compare-with-trimming-the-history-yourself">How does this compare with trimming the history yourself?</h2>
<p>Trimming works and costs nothing. But it has a failure mode nobody talks about: the model loses the reason behind a constraint. History gets cut at turn 40, and the &#8220;don&#8217;t mention competitors&#8221; rule from turn 3 is gone. The next response names a competitor.</p>
<p>Zep&#8217;s summary keeps decisions and constraints as first-class facts, which is why it survives the cut. If your assistant has no constraints like that, plain trimming is fine and cheaper.</p>
<h2 id="when-is-zep-the-wrong-call">When is Zep the wrong call?</h2>
<p>If your assistant is single-session by design (a document Q&amp;A tool where every conversation is independent), memory is dead weight and an extra network hop. If you need an exact, replayable log of every message for compliance, a graph extraction layer is the wrong storage primitive; keep your own transcript store alongside it.</p>
<p>Also skip it if you cannot tolerate a vendor in the request path. Self-hosting Graphiti is a real option, but it means owning Neo4j or FalkorDB, an extraction model, and the consolidation jobs.</p>
<h2 id="quick-summary">Quick Summary</h2>
<ul>
<li>Zep keeps a running session summary of roughly 150–250 words; it is the cheapest thing you can put in a prompt.</li>
<li>Use summary for &#8220;who is this&#8221;, search for named nouns like ticket or invoice numbers, and combine both for about 500 tokens.</li>
<li>Scope reads to a session and cap search at around 5 results, or fact accumulation quietly doubles your input tokens.</li>
<li>Custom extraction instructions help domain nouns such as SKUs, but raise ingest cost and can pollute search if vague.</li>
<li>Skip Zep if conversations never repeat or if you need exact transcripts for compliance rather than extracted facts.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-cut-a-long-chat-memory-bill-with-zep-summaries/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Give an AI Agent Long-Term Memory with Zep</title>
		<link>https://www.iaifeed.com/how-to-give-an-ai-agent-long-term-memory-with-zep</link>
					<comments>https://www.iaifeed.com/how-to-give-an-ai-agent-long-term-memory-with-zep#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Mon, 09 Nov 2026 12:42:54 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[zep]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-give-an-ai-agent-long-term-memory-with-zep</guid>

					<description><![CDATA[Zep stores facts, not chat logs. How to create users and sessions, feed messages in, and retrieve a memory block that fits in your prompt budget.]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.iaifeed.com/ai-tool/zep">Zep</a> is a memory layer for AI agents. You push conversation turns into it, it extracts facts into a temporal knowledge graph, and you pull back a small memory block that says what the user wants, did, and when.</p>
<p>The pitch is simple once you have hit the wall it addresses. Chat history in a prompt does not scale: forty turns of context costs money, confuses the model, and still misses the thing the user said in March. Zep keeps the March fact and hands you three hundred tokens of it.</p>
<p>This walkthrough goes from API key to a working memory retrieval, using the <code>zep-cloud</code> Python SDK, then covers the settings that decide whether it works for your product.</p>
<h2 id="what-does-zep-store-that-a-vector-database-does-not">What does Zep store that a vector database does not?</h2>
<p>A vector database stores chunks and returns the most similar ones. Zep stores <strong>entities and facts with timestamps</strong>, extracted by an LLM, and answers questions about them in a graph. If a user said &#8220;I use Postgres&#8221; in January and &#8220;we migrated to DuckDB&#8221; in June, a similarity search may return both. Zep&#8217;s graph knows the second supersedes the first.</p>
<p>That distinction is why the returned memory is short and accurate instead of long and partly wrong.</p>
<p><strong>Who this is for:</strong> chat products, support agents, and assistants where the same user returns over weeks. <strong>Who it is not for:</strong> single-session tools, or systems that need an exact audit log of every message, because Zep is summarising and extracting, not archiving.</p>
<h2 id="how-do-you-set-up-zep-in-five-minutes">How do you set up Zep in five minutes?</h2>
<p>Create a project in the Zep dashboard and copy the API key. Install the client:</p>
<pre><code>pip install zep-cloud
</code></pre>
<p>Initialize with your key. Then create a user and a session. Zep&#8217;s data model has exactly three levels, and mixing them up is the most common setup error:</p>
<ul>
<li><strong>User</strong> — a person. Persistent identity.</li>
<li><strong>Session</strong> (formerly called a thread) — one conversation. Belongs to a user.</li>
<li><strong>Message</strong> — one turn inside a session.</li>
</ul>
<pre><code>from zep_cloud.client import Zep
z = Zep(api_key=KEY)
z.user.add(user_id=&quot;u_1042&quot;, email=&quot;a@b.com&quot;)
z.memory.add_session(session_id=&quot;s_1&quot;, user_id=&quot;u_1042&quot;)
</code></pre>
<p>Older docs use <code>z.memory.add_thread</code>. Sessions and threads are the same object; the SDK renamed the surface in 2025 and both entry points still resolve for now.</p>
<h2 id="how-do-you-feed-messages-in">How do you feed messages in?</h2>
<p>Add both sides of the conversation, with role labels. Zep extracts facts from user turns and uses assistant turns for context.</p>
<pre><code>z.memory.add(session_id=&quot;s_1&quot;, messages=[
  {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;We moved billing to Stripe last month.&quot;},
  {&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: &quot;Got it, Stripe for billing.&quot;},
])
</code></pre>
<p>Processing is asynchronous. Extraction runs in the background and typically lands within a second or two for short messages. If the very next call in the same script reads memory, you may get an empty block. Deal with it by awaiting the task or by making retrieval tolerant of a miss.</p>
<h2 id="how-do-you-get-a-memory-block-back-into-your-prompt">How do you get a memory block back into your prompt?</h2>
<p>Two endpoints matter, and they answer different questions.</p>
<p><strong>Memory</strong> gives you the distilled facts for a session or a user. This is the one for a prompt, because you control the budget:</p>
<pre><code>mem = z.memory.get(session_id=&quot;s_1&quot;)
prompt_context = mem.context
</code></pre>
<p><strong>Search</strong> takes a query string and returns the most relevant facts and summaries:</p>
<pre><code>res = z.memory.search(session_id=&quot;s_1&quot;, text=&quot;what database do they use&quot;, limit=5)
</code></pre>
<p>Use memory for the &#8220;who is this person&#8221; preamble in every request. Use search when the user asks a question that needs a targeted lookup out of months of history.</p>
<h2 id="what-is-graphiti-and-do-you-need-it">What is Graphiti, and do you need it?</h2>
<p>Graphiti is Zep&#8217;s open-source engine, and it is what lets you build the graph yourself instead of through the hosted API. You need it if you want to run memory on your own infrastructure, or if you have custom entity types (say, medical codes or part numbers) that the default extractor will not recognise.</p>
<p>The hosted product and Graphiti produce the same shape of graph. The difference is operational: self-hosting means running Neo4j or FalkorDB, an LLM for extraction, and background consolidation jobs. That is three moving parts you do not manage on the cloud tier.</p>
<h2 id="what-does-it-cost-and-where-are-the-limits">What does it cost and where are the limits?</h2>
<p>Zep&#8217;s cloud pricing is per-credit, and credits burn on extraction and retrieval calls, not on message count. Free tier covers prototyping; production plans are usage-based and billed monthly at higher credits.</p>
<p>Three practical limits:</p>
<ol>
<li><strong>Extraction needs an LLM.</strong> On the cloud, Zep supplies it. Self-hosted, you pay your own model provider per message ingested, which on GPT-4-class models is roughly a cent per long conversation.</li>
<li><strong>Sessions need to be ended.</strong> A session that never closes keeps accumulating and eventually exceeds the summary window. Call the end-session path when a conversation concludes.</li>
<li><strong>Entity types are opinionated.</strong> The default extractor finds people, companies, projects and preferences. Domain-specific nouns need custom instructions, or they arrive as untyped text and search for them is weaker.</li>
</ol>
<h2 id="how-does-this-compare-with-just-storing-history">How does this compare with just storing history?</h2>
<p>A rough comparison for a support assistant that handles 30 turns per user and 200 users a day:</p>
<table>
<thead>
<tr>
<th>Approach</th>
<th>Tokens per request</th>
<th>Remembers March?</th>
<th>Effort</th>
</tr>
</thead>
<tbody>
<tr>
<td>Full history in prompt</td>
<td>4,000–12,000</td>
<td>Yes, if recent</td>
<td>None</td>
</tr>
<tr>
<td>Last 10 turns</td>
<td>1,500</td>
<td>No</td>
<td>Low</td>
</tr>
<tr>
<td>Vector search over turns</td>
<td>800</td>
<td>Maybe</td>
<td>Medium</td>
</tr>
<tr>
<td>Zep memory block</td>
<td>300–500</td>
<td>Yes, with dates</td>
<td>Medium</td>
</tr>
</tbody>
</table>
<p>At scale the token column is the argument. Cutting 8,000 tokens down to 400 per call at 6,000 calls a day is a real invoice difference, not a theoretical one.</p>
<h2 id="quick-summary">Quick Summary</h2>
<ul>
<li>Zep extracts timestamped facts into a graph instead of storing raw chat history, so facts that change get superseded rather than duplicated.</li>
<li>The data model is user, then session (formerly thread), then message; creating messages without a session is the usual first error.</li>
<li>Use <code>memory.get()</code> for a short prompt-ready block and <code>memory.search()</code> for targeted lookups over old history.</li>
<li>Ingestion is asynchronous, so tolerate an empty read immediately after writing.</li>
<li>Self-hosting Graphiti means running Neo4j or FalkorDB plus your own extraction LLM; the cloud tier removes all three.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-give-an-ai-agent-long-term-memory-with-zep/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Build a Multi-Session AI Assistant with Zep</title>
		<link>https://www.iaifeed.com/how-to-build-a-multi-session-ai-assistant-with-zep</link>
					<comments>https://www.iaifeed.com/how-to-build-a-multi-session-ai-assistant-with-zep#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Sat, 26 Sep 2026 12:41:48 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[zep]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-build-a-multi-session-ai-assistant-with-zep</guid>

					<description><![CDATA[Move beyond a single chat session. This walkthrough shows how to structure users, sessions, and graph search in Zep so your assistant remembers people across weeks.]]></description>
										<content:encoded><![CDATA[<p>One chat session is easy. The hard part is when the same person comes back on Tuesday and your agent forgot everything from Monday. <a href="https://www.iaifeed.com/ai-tool/zep">Zep</a> solves this with a user-and-session model, and this guide focuses on the wiring that trips people up.</p>
<p><strong>Direct answer:</strong> Create one Zep user per person, one session per conversation thread, then search across all sessions with <code>memory.search</code> to pull cross-thread context at answer time.</p>
<h2>Why Does One Big Session Break Down?</h2>
<p>New builders dump every message into a single session. It works for a demo, then falls apart. Summaries get noisy, latency grows, and Zep cannot tell a quick throwaway question from a project you have been running for months.</p>
<p>The fix is to treat sessions as threads, not as users. A user is a person. A session is one line of work — a support ticket, a coding task, a weekly check-in.</p>
<h2>How Should You Model Users and Sessions?</h2>
<p>Use stable IDs you already own. Do not let Zep invent them.</p>
<table>
<tr>
<th>Concept</th>
<th>Maps to</th>
<th>Example</th>
</tr>
<tr>
<td>user_id</td>
<td>Your account/user record</td>
<td><code>u_8421</code></td>
</tr>
<tr>
<td>session_id</td>
<td>One conversation thread</td>
<td><code>s_8421_2026_09_draft</code></td>
</tr>
<tr>
<td>graph</td>
<td>Optional shared knowledge pool</td>
<td><code>org_iaifeed</code></td>
</tr>
</table>
<p>If several sessions should share facts — say an org-wide policy — attach them to the same graph ID. Facts written there become visible to every session in that graph.</p>
<h2>How Do You Write and Read Across Sessions?</h2>
<p>Write with <code>memory.add</code> as messages happen. Read with <code>memory.search</code> when you want semantic lookup rather than just the last N messages.</p>
<pre><code>hits = client.memory.search(
    user_id="u_8421",
    query="preferred deployment target",
    limit=5)
for h in hits:
    print(h.fact, h.created_at)</code></pre>
<p>Note the parameter: <code>user_id</code>, not <code>session_id</code>. That is what makes search span threads. Searching by session only returns facts from that single thread — a common mistake that makes memory seem broken.</p>
<h2>Zep Memory Search vs Plain Vector Search</h2>
<p>Both retrieve facts. They differ in what they do with time.</p>
<table>
<tr>
<th>Capability</th>
<th>Vector store</th>
<th>Zep</th>
</tr>
<tr>
<td>Semantic similarity</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Invalidates outdated facts</td>
<td>No</td>
<td>Yes (temporal graph)</td>
</tr>
<tr>
<td>Auto summary per session</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Setup effort</td>
<td>Low</td>
<td>Medium</td>
</tr>
</table>
<p>If your users never change their mind, a vector store is cheaper. Once facts evolve, the temporal layer earns its keep.</p>
<h2>How Do You Handle Latency and Token Cost?</h2>
<p>Three practical levers worked for us on a real assistant:</p>
<ul>
<li>Request <code>mode="summary"</code> and cap <code>lastn</code> at 4-6 messages.</li>
<li>Trigger writes right after the user turn, not after the assistant reply, so ingestion overlaps with generation.</li>
<li>Cache the returned context string for the session and reuse it within one turn instead of calling <code>memory.get</code> twice.</li>
</ul>
<p>Skipping these pushed p95 latency from roughly 400 ms to over 1.5 s in our tests, mostly from unnecessary ingestion calls.</p>
<h2>Is the Graph Layer Worth the Complexity?</h2>
<p>Only sometimes. If your assistant answers questions about a single person&#8217;s history, a user-scoped memory is enough. The graph starts paying off when you need relationships — &#8220;which customers reported this bug&#8221; — where entities connect to each other, not just to a user.</p>
<p>One honest limitation: you cannot hand-edit the graph. Facts are extracted by a model, so bad input produces bad facts, and the only fix is re-ingesting corrected messages.</p>
<h2>Quick Summary</h2>
<ul>
<li>Model people as users and threads as sessions; never merge them.</li>
<li>Use <code>memory.search</code> with <code>user_id</code> to pull context across sessions.</li>
<li>Share facts between sessions through a common graph ID.</li>
<li>Keep token cost down with summary mode and a small <code>lastn</code>.</li>
<li>Skip the graph until you actually need entity relationships.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-build-a-multi-session-ai-assistant-with-zep/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Use Zep for AI Agent Memory</title>
		<link>https://www.iaifeed.com/how-to-use-zep-for-ai-agent-memory</link>
					<comments>https://www.iaifeed.com/how-to-use-zep-for-ai-agent-memory#respond</comments>
		
		<dc:creator><![CDATA[iamltlb]]></dc:creator>
		<pubDate>Sat, 26 Sep 2026 12:40:59 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[zep]]></category>
		<guid isPermaLink="false">https://www.iaifeed.com/how-to-use-zep-for-ai-agent-memory</guid>

					<description><![CDATA[Zep gives AI agents long-term memory through a temporal knowledge graph. Here is how to install it, add memories, and query them in under 30 minutes.]]></description>
										<content:encoded><![CDATA[<p>Zep is an open-source memory layer for AI agents. It stores conversations and facts in a temporal knowledge graph, then returns the right context when your agent needs it. If you are tired of stuffing chat history into every prompt, this guide shows how to get Zep running in about 30 minutes.</p>
<p><strong>Direct answer:</strong> Install Zep via Docker or its cloud API, add memories with the SDK, then query them with a user or session ID to get ranked context.</p>
<p>We will use <a href="https://www.iaifeed.com/ai-tool/zep">Zep</a> in Python, though it also ships Node and Go clients. All you need is an API key and one small script.</p>
<h2>What Is Zep and What Problem Does It Solve?</h2>
<p>Zep is a memory service that sits between your LLM and your application. Instead of feeding raw transcripts, you send messages to Zep as they happen. Zep extracts facts, tracks how they change over time, and returns a compact summary plus relevant facts on each turn.</p>
<p>The temporal part matters. If a user says &#8220;I live in Berlin&#8221; in January and &#8220;I moved to Lisbon&#8221; in June, Zep does not lose the history — it invalidates the old fact and keeps the new one current. Plain vector search usually cannot do this.</p>
<h2>How Do You Install Zep?</h2>
<p>You have two options. The hosted cloud (app.getzep.com) needs only an API key and is the fastest route. Self-hosting uses Docker Compose and bundles Postgres, Neo4j, and the Zep service.</p>
<ol>
<li>Create a free account at app.getzep.com and copy your API key.</li>
<li>Install the SDK: <code>pip install zep-cloud</code>.</li>
<li>Export your key: <code>export ZEP_API_KEY=your_key</code>.</li>
</ol>
<p>For self-hosting, clone the repo and run <code>docker compose up</code>. It spins up four containers and takes roughly 3-4 GB of RAM, so a cheap 2 GB VPS will struggle.</p>
<h2>How Do You Add Memories to Zep?</h2>
<p>Every memory is attached to a session, and sessions belong to a user. That two-level model is the core of Zep, so start by creating a user.</p>
<pre><code>from zep_cloud.client import Zep
client = Zep(api_key="your_key")
client.user.add(user_id="u_1", email="a@b.com")
client.memory.add_session(session_id="s_1", user_id="u_1")
client.memory.add(session_id="s_1", messages=[
  {"role": "user", "content": "I am allergic to peanuts"},
  {"role": "assistant", "content": "Noted."}
])</code></pre>
<p>Zep ingests messages asynchronously. Facts usually appear within a second or two, but do not expect them instantly in a tight loop.</p>
<h2>How Do You Query Memory and Inject It Into a Prompt?</h2>
<p>Call <code>memory.get</code> with the session ID. You get back a summary, a list of relevant facts, and recent message context. Drop those strings into your system prompt, not the whole transcript.</p>
<pre><code>mem = client.memory.get(session_id="s_1",
    lastn=6, mode="summary")
context = mem.context
prompt = f"Known facts about the user:\n{context}\n\nAnswer:\n{question}"</code></pre>
<p>Using <code>mode="summary"</code> keeps token counts low. Switching to <code>mode="basic"</code> returns more raw detail when you need exact wording.</p>
<h2>Is Zep Free?</h2>
<p>Zep Cloud has a free tier aimed at development, with paid plans billed on stored memories and API calls. The open-source version is free to self-host under the Apache 2.0 license. For a side project, self-hosting with Docker costs nothing beyond server time.</p>
<h2>Who Should Use Zep — and Who Should Not</h2>
<p>It fits chatbots, assistants, and support agents that talk to the same user across weeks. If your agent is stateless and answers single questions, Zep is overhead you do not need — a plain prompt cache will do.</p>
<p>Two real drawbacks. First, self-hosting pulls in Neo4j, which is heavy for small deployments. Second, fact extraction is probabilistic: occasionally an odd statement gets stored as a &#8220;fact&#8221; and you will need to prune it.</p>
<h2>Quick Summary</h2>
<ul>
<li>Zep is an open-source memory layer that stores agent conversations in a temporal knowledge graph.</li>
<li>Install the SDK with <code>pip install zep-cloud</code> or self-host through Docker Compose.</li>
<li>Everything hangs off two IDs: a user and a session.</li>
<li>Query with <code>memory.get</code> and inject the returned summary into your prompt.</li>
<li>Best for long-running assistants; overkill for one-shot Q&amp;A.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iaifeed.com/how-to-use-zep-for-ai-agent-memory/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
