You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at the Agent Engine documentation and its subsections to identify the key code samples needed. I see you've already started a PR (#13735), but in case it's still in progress or needs more coverage for the Sessions and Memory Bank sections, I’ve drafted a few snippets below that align with the current SDK.
These snippets follow the python-docs-samples format with region tags for easy documentation integration.
1. Create an Agent Engine instance with Memory Bank config
This sample shows how to initialize the client and create an engine specifically configured for memory generation.
# [START agent_builder_create_agent_engine]importvertexaidefcreate_agent_engine(project_id: str, location: str):
"""Creates an Agent Engine instance with Memory Bank configuration."""vertexai.init(project=project_id, location=location)
client=vertexai.Client(project=project_id, location=location)
# Create an engine with a specific model for memory generationagent_engine=client.agent_engines.create(
config={
"context_spec": {
"memory_bank_config": {
"generation_config": {
"model": f"projects/{project_id}/locations/{location}/publishers/google/models/gemini-1.5-flash"
}
}
}
}
)
print(f"Created Agent Engine: {agent_engine.api_resource.name}")
returnagent_engine# [END agent_builder_create_agent_engine]
2. Generate Memories
This snippet covers the Memory Bank subsection, allowing users to trigger memory extraction from stored sessions.
Let me know if these align with what you're planning for #13735, or if you'd like me to add snippets for specific frameworks like LangChain or ADK as mentioned in the overview!
Let me know if these align with what you're planning for #13735, or if you'd like me to add snippets for specific frameworks like LangChain or ADK as mentioned in the overview!
I've updated the PR to be just a draft, and am happy for you to contribute snippets (based on what you have in #13734 (comment) or beyond [if you already studied the documentation]), thank you so much!
Thanks @yeesian! I'll get these snippets organized into the correct file structure with region tags and add them to the PR (or create a new one linked to it) shortly. I'll also look into adding snippets for LangChain as mentioned.
Hi @yeesian, I've implemented the samples for creating/deleting agent engines and generating memories, including region tags and unit tests. I've pushed them to my branch [link to your branch] and can open a PR or add them to #13735 if preferred.
Activity
madhavmadupu commentedon Jan 11, 2026
Hi @yeesian,
I've been looking at the Agent Engine documentation and its subsections to identify the key code samples needed. I see you've already started a PR (#13735), but in case it's still in progress or needs more coverage for the Sessions and Memory Bank sections, I’ve drafted a few snippets below that align with the current SDK.
These snippets follow the
python-docs-samplesformat with region tags for easy documentation integration.1. Create an Agent Engine instance with Memory Bank config
This sample shows how to initialize the client and create an engine specifically configured for memory generation.
2. Generate Memories
This snippet covers the Memory Bank subsection, allowing users to trigger memory extraction from stored sessions.
3. Delete an Agent Engine instance
A standard cleanup snippet for the management subsection.
Let me know if these align with what you're planning for #13735, or if you'd like me to add snippets for specific frameworks like LangChain or ADK as mentioned in the overview!
yeesian commentedon Jan 12, 2026
I've updated the PR to be just a draft, and am happy for you to contribute snippets (based on what you have in #13734 (comment) or beyond [if you already studied the documentation]), thank you so much!
madhavmadupu commentedon Jan 12, 2026
Thanks @yeesian! I'll get these snippets organized into the correct file structure with region tags and add them to the PR (or create a new one linked to it) shortly. I'll also look into adding snippets for LangChain as mentioned.
madhavmadupu commentedon Jan 12, 2026
Hi @yeesian, I've implemented the samples for creating/deleting agent engines and generating memories, including region tags and unit tests. I've pushed them to my branch [link to your branch] and can open a PR or add them to #13735 if preferred.