-
Notifications
You must be signed in to change notification settings - Fork 50
v0.8 release docs #333
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
Merged
+936
−134
Merged
v0.8 release docs #333
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
31c7f1c
docs: add comprehensive concept, CRD reference, and enterprise docume…
ProfessorSeb 8cfb76d
docs: remove CRD reference and enterprise pages, keep only core concepts
ProfessorSeb 1a88f1a
first pass at updating blocking issues as follows: Blocking issues (9):
artberger a6840b2
memory topic updates based on demo
artberger ef60ae8
HITL topic updates based on demo
artberger d2872e6
add v0.8 release notes
artberger 9ea802f
apply style guide: second-person voice, active voice, periods on list…
artberger 8e82391
replace ASCII art diagram with structured prose in HITL architecture …
artberger ef2a384
add diagram for hitl
artberger d912bd0
navigation
artberger 1b95400
revise based on testing
artberger 2be6f1b
de-dupe
artberger d7431a8
add links to blogs
artberger be8c5eb
doc updates
artberger 44f2d00
docs: add missing subpage cards to all section landing pages
artberger 30ceabf
local preview
artberger 41dd62e
fix some cards
artberger 7cd219f
rm unused images
artberger f977b76
Remove SQLite
artberger 0f5a322
more details on bundled Postgres
artberger 1d6f03b
link
artberger 7569e7d
emphasize external postgres for prod
artberger 817d486
fix the sidebar nav
artberger 17fd08c
Add yanivmn as co-author
yanivmar 334b149
Add yanivmn as co-author
yanivmar 0922925
dco test
artberger e648ff3
Merge branch 'main' into add-comprehensive-docs
artberger 448a151
fix links
artberger dcd4346
peer review
artberger 89b6454
Update for reworked bundled postrgres
artberger 06c7b6e
Merge branch 'main' into add-comprehensive-docs
artberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| --- | ||
| title: "Agent Memory" | ||
| pageOrder: 5 | ||
| description: "Enable vector-backed long-term memory for agents to learn from past interactions." | ||
| --- | ||
|
|
||
| export const metadata = { | ||
| title: "Agent Memory", | ||
| description: "Enable vector-backed long-term memory for agents to learn from past interactions.", | ||
| author: "kagent.dev" | ||
| }; | ||
|
|
||
| # Agent Memory | ||
|
|
||
| With agent memory, your agents can automatically save and retrieve relevant context across conversations using vector similarity search. Memory is built on top of the Google ADK memory implementation. | ||
|
|
||
| ## Overview | ||
|
|
||
| Agent memory provides the following capabilities. | ||
|
|
||
| - **Vector-backed.** A basic vector store uses embedding models to encode memories as 768-dimensional vectors. | ||
| - **Searchable.** Agents retrieve relevant memories via cosine similarity. | ||
| - **Automatic.** Agents extract and save user intent, key learnings, and preferences without explicit user action. | ||
| - **Time-bounded.** Memories expire after a configurable TTL (default 15 days). | ||
| - **Shared storage.** Memory uses the kagent database (PostgreSQL), not a separate database. | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Enable Memory on an Agent | ||
|
|
||
| To enable memory, set the `memory` field on the declarative agent spec, as shown in the following YAML example. The `modelConfig` field references a `ModelConfig` object whose embedding provider generates memory vectors. | ||
|
|
||
| You can also configure memory in the kagent UI when you create or edit an agent. In the UI, select an embedding model and set the memory TTL. | ||
|
|
||
| ```yaml | ||
| apiVersion: kagent.dev/v1alpha2 | ||
| kind: Agent | ||
| metadata: | ||
| name: memory-agent | ||
| namespace: kagent | ||
| spec: | ||
| type: Declarative | ||
| declarative: | ||
| modelConfig: default-model-config | ||
| systemMessage: "You are a helpful assistant with long-term memory." | ||
| memory: | ||
| modelConfig: default-model-config # References the embedding provider | ||
| ``` | ||
|
|
||
| ### Custom TTL | ||
|
|
||
| To change the default memory retention period, set the `ttlDays` field. | ||
|
|
||
| ```yaml | ||
| memory: | ||
| modelConfig: default-model-config | ||
| ttlDays: 30 # Memories expire after 30 days instead of the default 15 | ||
| ``` | ||
|
|
||
| ## How Memory Works | ||
|
|
||
| ### Automatic Save Cycle | ||
|
|
||
| 1. The agent processes user messages normally. | ||
| 2. Every 5th user message, the agent automatically extracts key information such as user intent, key learnings, and preferences. | ||
| 3. The agent summarizes extracted memories and encodes them as embedding vectors. | ||
| 4. The agent stores the vectors in the database with metadata and timestamps. | ||
|
|
||
| ### Memory Retrieval (Prefetch) | ||
|
|
||
| Before generating a response, the agent performs the following steps. | ||
|
|
||
| 1. Encodes the current user message as an embedding vector. | ||
| 2. Searches stored memories by cosine similarity. | ||
| 3. Injects the most relevant memories into the agent's context. | ||
|
|
||
| ### Memory Tools | ||
|
|
||
| When you enable memory, the agent receives three additional tools. | ||
|
|
||
| | Tool | Description | | ||
| |------|-------------| | ||
| | `save_memory` | Explicitly save a piece of information. | | ||
| | `load_memory` | Search for relevant memories by query. | | ||
| | `prefetch_memory` | Automatically run before the agent generates a response to retrieve relevant memories. | | ||
|
|
||
| You can also instruct the agent to use `save_memory` or `load_memory` explicitly during a conversation. | ||
|
|
||
| ### Viewing Memories | ||
|
|
||
| In the kagent UI, you can view the memories that an agent has saved. With saved memories, you can inspect what the agent has learned and retained from past interactions. | ||
|
|
||
| ## Memory Management via API | ||
|
|
||
| The following API endpoints let you manage memories programmatically. | ||
|
|
||
| ``` | ||
| POST /api/memories/sessions # Add a memory | ||
| POST /api/memories/sessions/batch # Add memories in batch | ||
| POST /api/memories/search # Search memories by cosine similarity | ||
| GET /api/memories?agent_name=X&user_id=Y # List memories | ||
| DELETE /api/memories?agent_name=X&user_id=Y # Delete all memories for an agent | ||
| ``` | ||
|
|
||
| ## Limitations | ||
|
|
||
| - **No per-memory deletion.** You can delete all memories for an agent, but you cannot delete individual memory entries. | ||
| - **No cross-agent memory sharing.** Each agent has its own isolated memory store. You cannot share memories across agents. | ||
| - **Not pluggable.** Memory is built on the Google ADK memory implementation and cannot be swapped for an alternative memory solution (such as Cognee). However, if an alternative memory solution exposes an [MCP server](/docs/kagent/concepts/tools#mcp-tools), you can add it as a tool and instruct the agent to use it instead of the built-in memory. | ||
|
|
||
| ## Technical Details | ||
|
|
||
| - Embedding vectors are normalized to 768 dimensions. | ||
| - Background TTL pruning runs periodically with a default retention of 15 days. Memories older than the retention period are automatically deleted. | ||
| - Memories include timestamps and source session references. |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some places agent is capitalized and some places it's not. For my own benefit, is there a time when you're speaking specifically about a product Agent, but other times, like the general concept of an agent? Like thats the dfferentiation?