Original article excerpt
Server-side extracted preview paragraphs from the original source.
In this post, we demonstrate how you can extend the conversational memory of Kiro CLI by implementing a custom Model Context Protocol (MCP) server that integrates with Amazon Bedrock AgentCore Memory. 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.
Agentic 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.
In this post, we demonstrate how you can extend the conversational memory of Kiro CLI by implementing a custom Model Context Protocol (MCP) server that integrates with Amazon Bedrock AgentCore Memory. 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.
The 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.
The 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.
This 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.
The AWS Identity and Access Management (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.