Conversation memory and session management MCP server for Amazon Q CLI with ChromaDB real-time sync
Project description
AWS Q Memory MCP Server (q_mem_mcp_server)
A Model Context Protocol (MCP) server that provides conversation memory and session management for Amazon Q CLI.
๐ฏ Key Features
- Automatic Conversation Saving: Real-time sync of Q CLI conversations to ChromaDB
- Session Management: Organize conversations by topics/sessions
- Context Restoration: Resume previous conversations with full context memory
- Semantic Search: Search through conversation history using natural language
๐ Quick Start
1. MCP Configuration
Add to ~/.aws/amazonq/mcp.json:
{
"mcpServers": {
"q-mem": {
"command": "uvx",
"args": ["q_mem_mcp_server@latest"],
"env": {
"Q_CLI_DB_PATH": "~/Library/Application Support/amazon-q/data.sqlite3",
"Q_MEM_VERBOSE": "true"
},
"disabled": false,
"autoApprove": [
"start_session",
"resume_session",
"search_memory_by_session_id",
"get_storage_stats",
"list_sessions"
]
}
}
}
2. Usage Examples
# Start Q CLI
q chat
# Start a new session
start_session(description="backendDev")
# or natural language: "Start session a backendDev"
# Chat normally (automatically saved)
# ... have conversations ...
# List sessions
list_sessions()
# or natural language: "show me session list"
# Resume session (loads full context)
resume_session(session_id="backendDev")
# or natural language: "resume session a backendDev"
๐ ๏ธ Available Commands
| Command | Description |
|---|---|
start_session(description) |
Start a new session |
list_sessions() |
List all sessions |
resume_session(session_id) |
Resume session with full context |
search_memory_by_session_id(session_id, query) |
Search previous conversations |
delete_session(session_id, confirm=true) |
Delete a session |
get_storage_stats() |
Check storage status |
๐ง Technology Stack
- ChromaDB: Vector database for conversation storage and search
- SQLite WAL: Real-time sync with Q CLI database
- Sentence Transformers: Semantic search embeddings
- MCP Protocol: Communication with Amazon Q
๐ Data Storage
- ChromaDB:
~/.Q_mem/chroma_db/ - Sync State:
~/.Q_mem/sync_state.json - Logs:
~/.Q_mem/q_mem.log
๐ Auto-Sync Features
Q CLI conversations are automatically saved to ChromaDB in real-time:
- Real-time Detection: Checks for new conversations every 2 seconds
- Partial Failure Handling: Saves successful conversations even if some fail
- Auto Recovery: Automatically recovers from consecutive failures
- State Restoration: Restores sync state after restart
๐ก Usage Tips
- Session Organization: Separate conversations by topics, roles, or projects
- Semantic Search: Use natural language rather than exact keywords
- Context Utilization: Use
resume_sessionfor complete conversation restoration - Regular Cleanup: Delete unnecessary sessions to maintain performance
Memory Management
# Clean up old sessions
cleanup_old_sessions(days=30, confirm=true)
# or natural language: "remove old sessions"
# Delete specific session
delete_session(session_id="session_name", confirm=true)
# or natural language: "delete session session_name"
๐ License
MIT License
๐ Links
- PyPI: https://pypi.org/project/q_mem_mcp_server/
- GitHub: https://github.com/jikang-jeong/aws-q-mem-mcp-server
- Issues: https://github.com/jikang-jeong/aws-q-mem-mcp-server/issues
AWS Q Memory MCP Server (q_mem_mcp_server) - KOR
Amazon Q CLI๋ฅผ ์ํ ๋ํ ๋ฉ๋ชจ๋ฆฌ ๋ฐ ์ธ์ ๊ด๋ฆฌ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ Model Context Protocol (MCP) ์๋ฒ์ ๋๋ค.
๐ฏ ์ฃผ์ ๊ธฐ๋ฅ
- ์๋ ๋ํ ์ ์ฅ: Q CLI ๋ํ๋ฅผ ChromaDB์ ์ค์๊ฐ ๋๊ธฐํ
- ์ธ์ ๊ด๋ฆฌ: ์ฃผ์ /์ธ์ ๋ณ๋ก ๋ํ ์ ๋ฆฌ
- ์ปจํ ์คํธ ๋ณต์: ์ด์ ๋ํ์ ์ ์ฒด ์ปจํ ์คํธ์ ํจ๊ป ์ฌ๊ฐ
- ์๋ฏธ ๊ฒ์: ์์ฐ์ด๋ฅผ ์ฌ์ฉํ ๋ํ ๊ธฐ๋ก ๊ฒ์
๐ ๋น ๋ฅธ ์์
1. MCP ์ค์
~/.aws/amazonq/mcp.json์ ์ถ๊ฐ:
{
"mcpServers": {
"q-mem": {
"command": "uvx",
"args": ["q_mem_mcp_server@latest"],
"env": {
"Q_CLI_DB_PATH": "~/Library/Application Support/amazon-q/data.sqlite3",
"Q_MEM_VERBOSE": "true"
},
"disabled": false,
"autoApprove": [
"start_session",
"resume_session",
"search_memory_by_session_id",
"get_storage_stats",
"list_sessions"
]
}
}
}
2. ์ฌ์ฉ ์์
# Q CLI ์์
q chat
# ์ ์ธ์
์์
start_session(description="๋ฐฑ์๋๊ฐ๋ฐ")
# ๋๋ ์์ฐ์ด: "๋ฐฑ์๋๊ฐ๋ฐ ์ธ์
์์ํด์ค"
# ์ผ๋ฐ์ ์ผ๋ก ๋ํ (์๋ ์ ์ฅ๋จ)
# ... ๋ํ ์งํ ...
# ์ธ์
๋ชฉ๋ก ๋ณด๊ธฐ
list_sessions()
# ๋๋ ์์ฐ์ด: "์ธ์
๋ชฉ๋ก ๋ณด์ฌ์ค"
# ์ธ์
์ฌ๊ฐ (์ ์ฒด ์ปจํ
์คํธ ๋ก๋)
resume_session(session_id="๋ฐฑ์๋๊ฐ๋ฐ")
# ๋๋ ์์ฐ์ด: "๋ฐฑ์๋๊ฐ๋ฐ ์ธ์
์ผ๋ก ์ฌ๊ฐํด์ค"
๐ ๏ธ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ช ๋ น์ด
| ๋ช ๋ น์ด | ์ค๋ช |
|---|---|
start_session(description) |
์ ์ธ์ ์์ |
list_sessions() |
๋ชจ๋ ์ธ์ ๋ชฉ๋ก ๋ณด๊ธฐ |
resume_session(session_id) |
์ ์ฒด ์ปจํ ์คํธ์ ํจ๊ป ์ธ์ ์ฌ๊ฐ |
search_memory_by_session_id(session_id, query) |
์ด์ ๋ํ ๊ฒ์ |
delete_session(session_id, confirm=true) |
์ธ์ ์ญ์ |
get_storage_stats() |
์ ์ฅ์ ์ํ ํ์ธ |
๐ง ๊ธฐ์ ์คํ
- ChromaDB: ๋ํ ์ ์ฅ ๋ฐ ๊ฒ์์ ์ํ ๋ฒกํฐ ๋ฐ์ดํฐ๋ฒ ์ด์ค
- SQLite WAL: Q CLI ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ค์๊ฐ ๋๊ธฐํ
- Sentence Transformers: ์๋ฏธ ๊ฒ์ ์๋ฒ ๋ฉ
- MCP Protocol: Amazon Q์์ ํต์
๐ ๋ฐ์ดํฐ ์ ์ฅ
- ChromaDB:
~/.Q_mem/chroma_db/ - ๋๊ธฐํ ์ํ:
~/.Q_mem/sync_state.json - ๋ก๊ทธ:
~/.Q_mem/q_mem.log
๐ ์๋ ๋๊ธฐํ ๊ธฐ๋ฅ
Q CLI ๋ํ๊ฐ ChromaDB์ ์ค์๊ฐ์ผ๋ก ์๋ ์ ์ฅ๋ฉ๋๋ค:
- ์ค์๊ฐ ๊ฐ์ง: 2์ด๋ง๋ค ์๋ก์ด ๋ํ ํ์ธ
- ๋ถ๋ถ ์คํจ ์ฒ๋ฆฌ: ์ผ๋ถ ์คํจํด๋ ์ฑ๊ณตํ ๋ํ๋ ์ ์ฅ
- ์๋ ๋ณต๊ตฌ: ์ฐ์ ์คํจ ์ ์๋ ๋ณต๊ตฌ
- ์ํ ๋ณต์: ์ฌ์์ ํ ๋๊ธฐํ ์ํ ๋ณต์
๐ก ์ฌ์ฉ ํ
- ์ธ์ ์ ๋ฆฌ: ์ฃผ์ , ์ญํ , ํ๋ก์ ํธ๋ณ๋ก ๋ํ ๋ถ๋ฆฌ
- ์๋ฏธ ๊ฒ์: ์ ํํ ํค์๋๋ณด๋ค ์์ฐ์ด ์ฌ์ฉ
- ์ปจํ
์คํธ ํ์ฉ: ์์ ํ ๋ํ ๋ณต์์ ์ํด
resume_session์ฌ์ฉ - ์ ๊ธฐ ์ ๋ฆฌ: ์ฑ๋ฅ ์ ์ง๋ฅผ ์ํด ๋ถํ์ํ ์ธ์ ์ญ์
๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ
# ์ค๋๋ ์ธ์
์ ๋ฆฌ
cleanup_old_sessions(days=30, confirm=true)
# ๋๋ ์์ฐ์ด: "์ค๋๋ ์ธ์
์ญ์ ํด์ค"
# ํน์ ์ธ์
์ญ์
delete_session(session_id="์ธ์
์ด๋ฆ", confirm=true)
# ๋๋ ์์ฐ์ด: "์ธ์
์ด๋ฆ ์ธ์
์ญ์ ํด์ค"
๐ ๋ผ์ด์ ์ค
MIT License
๐ ๋งํฌ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file q_mem_mcp_server-1.0.3.tar.gz.
File metadata
- Download URL: q_mem_mcp_server-1.0.3.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09bfb95cd553bd102da95ab166a040a1452515a4b708e1750c01602196d3e864
|
|
| MD5 |
9d01e09edd6e59cc21f189e5b7d5f4f2
|
|
| BLAKE2b-256 |
835fe76a74060b801f4ea96adc874beb8676ab7c2b8691d24de6472cc7e8caa3
|
File details
Details for the file q_mem_mcp_server-1.0.3-py3-none-any.whl.
File metadata
- Download URL: q_mem_mcp_server-1.0.3-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee98ce343697838c372c27026cafc320937fd1ba6b6c226cc0efeb09209822d6
|
|
| MD5 |
eab15830347333edb119cbc4cc8a6b2c
|
|
| BLAKE2b-256 |
991202ecc6640e0aca3a02dda3061ca07c867720a174c382764de2e0fe2cfc98
|