How kamalesh0081/mcp-aws-memory-agent works
This is a command-line conversational memory agent: a user’s message is handled by a LangChain agent using Gemini, which can call MCP memory tools; those tools retrieve or save memories in S3. The main stages are conversation, tool dispatch, memory operations, and persistence, with logging as a supporting layer. The README documents cross-session memory and the Gemini/LangChain/MCP capabilities; the graph follows the sampled source for their wiring. The S3 helper also writes a local JSON copy. Its error path references logging without importing it, so no working logging link from that helper is shown.
Main entry points: agent.py Conversational agent · s3_memory.py S3 memory operations · mcp_server.py MCP server · logger.py Conversation logger
Components 11
Conversation
- Conversational agent
agent.py - Gemini model
Agent orchestration
- MCP client
agent.py - MCP server
mcp_server.py
Memory service
- Save memory tool
mcp_server.py - Retrieve memory tool
mcp_server.py
Persistence and logs
- S3 memory operations
s3_memory.py - AWS S3
- Local memory copy
user_memory.json - Conversation logger
logger.py
Other components
- User
Connections 15
- User → Conversational agent: sends message
agent.py - Conversational agent → Gemini model: invokes model
agent.py - Conversational agent → MCP client: requests tools
agent.py - MCP client → MCP server: connects over HTTP
agent.py - MCP server → Save memory tool: registers tool
mcp_server.py - MCP server → Retrieve memory tool: registers tool
mcp_server.py - Save memory tool → S3 memory operations: saves memory
mcp_server.py - Retrieve memory tool → S3 memory operations: retrieves memories
mcp_server.py - S3 memory operations → AWS S3: reads object
s3_memory.py - S3 memory operations → AWS S3: writes object
s3_memory.py - S3 memory operations → Local memory copy: writes copy
s3_memory.py - Conversational agent → Conversation logger: logs conversation
agent.py - Save memory tool → Conversation logger: logs save
mcp_server.py - Retrieve memory tool → Conversation logger: logs retrieval
mcp_server.py - Conversational agent → User: shows response
agent.py