Amazon Q CLI용 대화 기억 및 세션 관리 MCP 서버 - ChromaDB 기반 실시간 동기화
Project description
Q Memory 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. Installation
cd /path/to/q-mem-mcp-server
pip install -e .
2. MCP Configuration
Add to ~/.config/q/mcp_config.json:
{
"mcpServers": {
"q-mem": {
"command": "python",
"args": ["-m", "q_mem_mcp.server"],
"env": {}
}
}
}
3. Usage
# Start Q CLI
q chat
# Start a new session
start_session(description="Python Learning")
# Chat normally (automatically saved)
# ... have conversations ...
# List sessions
list_sessions()
# Resume session (loads full context)
resume_session(session_id="Python_Learning_0709_1234")
🛠️ 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
- Semantic Search: Use natural language rather than exact keywords
- Context Utilization: Use
resume_sessionfor complete conversation restoration - Regular Cleanup: Delete unnecessary sessions with
delete_session
🐛 Troubleshooting
Q CLI Sync Issues
# Set environment variable
export Q_CLI_DB_PATH="/path/to/q/cli/database"
# Or check auto-detection
get_storage_stats()
ChromaDB Errors
# Recreate database
rm -rf ~/.Q_mem/chroma_db/
# Run start_session again
Memory Issues
# Clean up old sessions
cleanup_old_sessions(days=30, confirm=true)
📄 License
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.0.tar.gz.
File metadata
- Download URL: q_mem_mcp_server-1.0.0.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f0695ac4076814f7b1e39b98ea3523f8e9e0e85780bf1770789fddbc80d1b48
|
|
| MD5 |
9c75e84dda2692070e3c7a17bd992a4b
|
|
| BLAKE2b-256 |
95f8fdee1f7d8eda1e42709b62cf625bf04b0d8e612aefbbb8092fb0c770597b
|
File details
Details for the file q_mem_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: q_mem_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 26.3 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 |
632710d68ea21ddb313ee0a00a9875806b0cd3f1bb15cb41baacbf0f94eae252
|
|
| MD5 |
e750f45e8ff141600371420e46c03b64
|
|
| BLAKE2b-256 |
2b5450b2c15ff41b490a718c1bcb4266bf240436009f648fbcb5ce68610b597a
|