{"slug": "extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore", "title": "Extending conversational memory in Kiro CLI using Amazon Bedrock AgentCore Memory", "summary": "Kiro CLI now retains conversational memory across sessions by integrating Amazon Bedrock AgentCore Memory through a custom Model Context Protocol server. The solution stores and retrieves conversation history, preferences, and project context using semantic search and session tracking, eliminating the need for developers to repeatedly provide the same information. This persistent memory capability makes the terminal-based AI agent context-aware, improving productivity for developers working on complex codebases over extended periods.", "body_md": "[Artificial Intelligence](https://aws.amazon.com/blogs/machine-learning/)\n\n# Extending conversational memory in Kiro CLI using Amazon Bedrock AgentCore Memory\n\nAgentic IDEs that forget what you told them in previous sessions aren’t very helpful. You work on your large codebase with complex business requirements for days or weeks. However, your IDE only remembers you during your current session and can’t recall your conversational history, preferences derived from the conversations, or additional insights. You end up providing the same contextual information in every new session. This need for repetitive context-setting impacts your productivity.\n\nIn this post, we demonstrate how you can extend the conversational memory of [Kiro CLI](https://kiro.dev/cli/) by implementing a custom [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro) (MCP) server that integrates with [Amazon Bedrock AgentCore Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html). You can use Kiro CLI to interact with AI agents of Kiro directly from your terminal. Amazon Bedrock AgentCore Memory is a fully managed service that allows AI agents to retain information from past interactions, creating more intelligent and context-aware conversations. By implementing a custom MCP server, you can provide Kiro CLI with tools to store and retrieve conversation context, monitor memory usage, and manage the underlying Bedrock Agent Core Memory infrastructure.\n\n## Solution overview\n\nThe solution consists of three main components working together:\n\nis a fully managed service that stores and retrieves conversation context, providing persistent memory capabilities with built-in semantic search. AgentCore Memory provides powerful capabilities for maintaining both short-term working memory and long-term intelligent memory, so AI agents can retain context, learn from interactions, and deliver truly personalized experiences.[Amazon Bedrock AgentCore Memory](https://aws.amazon.com/blogs/machine-learning/amazon-bedrock-agentcore-memory-building-context-aware-agents/)**Custom MCP Server** exposes Amazon Bedrock AgentCore Memory capabilities through the MCP, making memory operations accessible to MCP-compatible clients.**Kiro CLI c** onnects to the MCP server through STDIO protocols to store and retrieve conversational history.\n\nThe MCP server acts as a bridge between Kiro CLI and Amazon Bedrock AgentCore Memory, allowing the Kiro CLI to maintain conversation history and context across sessions.The MCP server provides tools organized into three categories.\n\n**Conversation tools**– you can search conversation history by topic or timeframe, store conversations with consistent session tracking, retrieve complete conversation content, and list previously stored sessions.**Monitoring tools**– you can view memory usage statistics and MCP server config** Management tools**– you can delete specific sessions and delete stored data when needed.\n\nThe solution uses a two-stage retrieval strategy: it first attempts semantic search using the retrieve_memory_records Bedrock AgentCore Memory API for conceptual matching, then falls back to direct event-level content matching, scanning raw conversation payloads stored in AgentCore Memory sessions. This cascading approach makes sure that conversations are retrievable regardless of whether the semantic strategy has finished processing them. You can use timeframes in your prompt like *recent*, *last night*, or *yesterday* to find relevant conversations.\n\nThis architecture makes Kiro CLI context-aware. It remembers your preferences, project details, and workflows across sessions, so you don’t need to repeatedly provide the same information.\n\n## Walkthrough\n\nFor this demo, you should have the following prerequisites:\n\n- Access to an\n[AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html)through the AWS Management Console and the[AWS Command Line Interface (AWS CLI)](https://aws.amazon.com/cli).\n\nThe [AWS Identity and Access Management (IAM)](https://aws.amazon.com/iam) user that you use must have permissions to make the necessary AWS service calls and manage AWS resources mentioned in this post. While providing permissions to the IAM user, follow the [principle of least-privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).\n\n- An\n[AWS Builder ID](https://docs.aws.amazon.com/signin/latest/userguide/create-builder-id.html). - Kiro CLI\n[installed](https://kiro.dev/docs/cli/installation/)on your desktop/laptop and[configured](https://kiro.dev/docs/cli/authentication/#sign-in-to-kiro-cli).\n\nRun the following steps from the terminal:\n\n- Run the following command to clone the repository:\n- Run the following command to create a Python virtual environment and install dependencies:\n- Run the following command to create an Amazon Bedrock AgentCore Memory resource and generate Kiro agent config. Note that it might take a couple of minutes complete this step:\n\nWhen prompted, choose one of the following options for an actor identifier. The conversions are stored against this identifier.\n\n- Option 1: User ID (default) – this is recommended for personal use. This uses your system username from the USER environment variable. The preceding command sets\n`ACTOR_ID_TYPE=userid in agent/kiro_memory.json`\n\n- Option 2: Project ID – this is recommended for team or project-based memory isolation. When prompted, you must provide\n`projectid`\n\nand`your-project-id`\n\n. The preceding command sets`ACTOR_ID_TYPE=projectid`\n\nand`PROJECT_ID=your-project-id`\n\nin`agent/kiro_memory.json`\n\nThe namespace strategy used is: `/strategy/semanticMemoryStrategy/actor/{actorId}/session/{sessionId}`\n\n- Setup kiro agent configuration\n- Configure kiro_memory agent as the default agent.\n\nAdd the following to the `cli.json`\n\nfile in `~/.kiro/settings/`\n\ndirectory to use `kiro_memory`\n\nagent by default: `{\"chat.defaultAgent\": \"kiro_memory\"}`\n\n- Login to Kiro CLI\n\nFor logging in to Kiro CLI, you will need either an AWS Builder ID or an active Kiro subscription from your organization.\n\nIf you don’t have either one, you can create an AWS Builder ID by completing the steps in [Create your AWS Builder ID](https://docs.aws.amazon.com/signin/latest/userguide/create-builder-id.html).\n\n`kiro-cli login --use-device-flow`\n\nFor the log in method, select **Use for Free with Builder ID** using your keyboard arrow keys and press enter.\n\nA URL will be generated to create new Builder ID. Select **Open this URL** or copy paste the link in a new browser tab.\n\nLog in with the Builder ID that you just created.\n\nYou will get a prompt to confirm the request. Select **Confirm and continue**.\n\nIt will now ask you for permission to allow Kiro CLI to access the data. Click Allow access.\n\nNow go back to your local terminal and you should see the message Logged in successfully. Enter the following command on the terminal:\n\n`kiro-cli --classic`\n\nNow, on the Kiro CLI enter the command `/mcp`\n\nto see the list of MCP servers configured on this session.\n\nAfter the MCP server has successfully initialized, run the `/tools`\n\ncommand to list the tools available in the session.\n\nNotice that the following tools are available to the session through the `agentcore-memory-mcp-server`\n\n.\n\n`clear_all_data`\n\n– Delete the information from a particular namespace in memory`delete_session`\n\n– Delete a particular session`get_direct_conversation_history`\n\n– Access complete conversation content for specific sessions`get_memory_stats`\n\n– uses list_memory_records to provide an overview of the memory`get_server_config`\n\n– provides the configuration of the MCP server`get_session_details`\n\n– provides information about a particular session`list_sessions`\n\n– List previously stored sessions`search_conversation_history`\n\n– Tool for searching conversation history by topic or timeframe`search_memories`\n\n– Another tool for searching long term memory`store_conversation`\n\n– Store conversations with consistent session IDs\n\n## Test the solution\n\nKiro CLI invokes MCP servers based on the functionality required to respond or act based on your prompt. Kiro CLI hooks trigger and store the conversation after every conversation. Here are some usage examples:\n\n`What is AWS DevOps agent? Is it GA yet?`\n\nAllow tool access that Kiro may ask for approval to use. After getting the response quit the Kiro CLI by typing `/quit`\n\n.\n\nRe-login to Kiro CLI and ask:\n\n`What have we discussed about AWS DevOps agent?`\n\nAllow tool usage request from Kiro CLI. Kiro will use the `agentcore-memory-mcp-server`\n\nto fetch relevant information from Bedrock AgentCore memory.\n\nYou can ask follow up questions like:\n\n```\nCan I integrate GitHub with AWS DevOps agent?\nWhat is the pricing for AWS DevOps agent?\n```\n\nAgain `/quit`\n\nthe Kiro CLI session and re-login after some time. Ask Kiro CLI to retrieve previous discussion about AWS DevOps Agent in your natural language. Kiro shows you the summary of previous discussion.\n\nRefer to the following recorded demo for more details:\n\n## Cleaning up\n\nIf you followed along only for demonstration purpose, to avoid incurring future charges, run the following command to delete the resources created in this post:\n\n`python3 cleanup_bedrock_agentcore_memory.py`\n\nDelete the Agent configuration created in this post from your kiro directory (`~/.kiro/agents/kiro_memory.json`\n\n)\n\nDelete the hooks created in this post from your kiro directory (`~/.kiro/hooks/`\n\n)\n\n## Conclusion\n\nIn this post, we demonstrated how you can enhance context persistence of Kiro CLI using a custom MCP server that integrates with Amazon Bedrock AgentCore Memory. The custom MCP server provides comprehensive tools for storing and retrieving conversation contexts, monitoring memory usage, and managing your persistent memory infrastructure. With features like smart retrieval, natural language timeframes, and cascading fallback strategies, you can reliably access your conversation history without repeatedly providing the same contextual information.", "url": "https://wpnews.pro/news/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore", "canonical_source": "https://aws.amazon.com/blogs/machine-learning/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore-memory/", "published_at": "2026-05-19 15:23:22+00:00", "updated_at": "2026-05-26 08:08:43.967551+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "ai-tools", "ai-infrastructure", "large-language-models"], "entities": ["Amazon Bedrock AgentCore Memory", "Kiro CLI", "Model Context Protocol", "Kiro"], "alternates": {"html": "https://wpnews.pro/news/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore", "markdown": "https://wpnews.pro/news/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore.md", "text": "https://wpnews.pro/news/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore.txt", "jsonld": "https://wpnews.pro/news/extending-conversational-memory-in-kiro-cli-using-amazon-bedrock-agentcore.jsonld"}}