Agent with persistent memory
The main goal of this flow is for the AI agent to maintain a coherent dialogue, allowing the response to be based on the full context.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
ChatInput-tj4g4[<div><img alt="logo" src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Input]
style ChatInput-tj4g4 stroke:#a170ff
ChatOutput-17n0s[<div><img alt="logo" src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-17n0s stroke:#a170ff
GoogleGenerativeAIModel-6dquc[Google Generative AI]
style GoogleGenerativeAIModel-6dquc stroke:#a170ff
AdvancedAgent-09rkl[Agent]
style AdvancedAgent-09rkl stroke:#a170ff
GoogleGenerativeAIModel-6dquc -.- AdvancedAgent-09rkl
linkStyle 0 stroke:#a170ff
ChatInput-tj4g4 -.- AdvancedAgent-09rkl
linkStyle 1 stroke:#a170ff
AdvancedAgent-09rkl -.- ChatOutput-17n0s
linkStyle 2 stroke:#a170ff
đź§© Overview
The workflow enables a conversational agent that retains context across turns.
A user supplies a message through the chat input, the agent processes it with a Gemini‑based language model (plus optional tools and memory), and the reply is displayed in the playground.
By automating dialogue management, the workflow provides a seamless, stateful chat experience without manual session handling.
⚙️ Main Features
- User‑friendly chat input that accepts text and optional attachments.
- Gemini‑powered language model for natural language generation.
- Advanced agent that coordinates tool usage, memory summarization, and multi‑turn coherence.
- Optional streaming of the agent’s reasoning for real‑time insight.
- Configurable structured‑output schemas to enforce response formats.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Label Component | Provides a descriptive overview of the system within the playground. | None | Text label displayed in the interface. |
| Chat Input | Captures user messages and any attached files. | User text, optional files, conversation metadata. | Message object containing the user input. |
| Google Generative AI | Instantiates a Gemini language model and can generate text. | Prompt text (optional), system messages, model settings. | Language model instance (model_output) and optional generated text (text_output). |
| Advanced Agent | Orchestrates dialogue using the LLM, memory, and tools to produce a context‑aware reply. | User message (arg_input), LLM (llm), memory, tools. |
Response message containing the agent’s reply. |
| Chat Output | Renders the agent’s response back to the user interface. | Response message. | Displayed chat message. |
đź§ Notes
- The label component is purely informational and does not participate in data flow.
- The agent’s memory strategy is set to “Summarize,” ensuring older context is condensed to keep the conversation efficient.
- Streaming of the agent’s internal reasoning can be turned on for step‑by‑step visibility.
- The Gemini model (
gemini‑2.5‑flash) is selected for a balance of speed and quality; alternative models may be chosen by updating the model selector. - Structured output is disabled by default; enabling it requires a JSON schema that the agent must follow.