qdrant-memory
БесплатноБез исполняемых скриптовНе проверенIntelligent token optimization through Qdrant-powered semantic caching and long-term memory. Use for (1) Semantic Cache - avoid LLM calls entirely for…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Qdrant Memory Skill
Token optimization engine using Qdrant vector database for semantic caching and intelligent memory retrieval.
Architecture Overview
┌─────────────────────────────────────────────────────────────┐
│ USER QUERY │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 1. SEMANTIC CACHE CHECK (Cache Hit = 100% Token Savings) │
│ ┌─────────────────┐ ┌─────────────────────────────────┐ │
│ │ Embed Query │───▶│ Search Qdrant (similarity>0.9) │ │
│ └─────────────────┘ └─────────────────────────────────┘ │
│ │ │
│ ┌─────────────────┴──────────────────┐ │
│ ▼ ▼ │
│ [CACHE HIT] [CACHE MISS] │
│ Return cached Continue to │
│ response LLM │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 2. CONTEXT RETRIEVAL (RAG - 80-95% Context Reduction) │
│ ┌─────────────────┐ ┌─────────────────────────────────┐ │
│ │ Identify Need │───▶│ Retrieve Top-K Relevant Chunks │ │
│ └─────────────────┘ └─────────────────────────────────┘ │
│ Instead of 20K tokens ───▶ Only 500-1000 tokens │
└─────────────────────────────────────────────────────────────┘
Prerequisites
Qdrant (Vector Database)
# Option 1: Docker (recommended)
docker run -d -p 6333:6333 -v qdrant_storage:/qdrant/storage qdrant/qdrant
# Option 2: Docker Compose (persistent)
# See references/complete_guide.md for docker-compose.yml
Embeddings Provider
Choose based on your needs:
| Provider | Privacy | Cost | Speed | Setup |
|---|---|---|---|---|
| Ollama (recommended) | ✅ Fully Local | Free | Fast (Metal) | brew install ollama |
| Bedrock (AWS/Kiro) | ⚡ AWS Cloud | ~$0.02/1M tokens | Fast | Uses AWS profile (no key) |
| OpenAI | ❌ Cloud | ~$0.02/1M tokens | Fast | API key required |
Ollama Setup (M3 Mac Optimized)
# 1. Install Ollama (if not already installed)
brew install ollama
# 2. Start server (choose one option)
ollama serve # Foreground (Ctrl+C to stop)
ollama serve & # Background (current terminal)
nohup ollama serve & # Background (survives terminal close)
# 3. Pull embedding model (768 dimensions, excellent quality)
ollama pull nomic-embed-text
# 4. Verify server is running
curl http://localhost:11434/api/tags
# 5. Test embedding generation
curl http://localhost:11434/api/embeddings -d '{"model":"nomic-embed-text","prompt":"hello"}'
Tip: To auto-start Ollama on login, add
ollama serve &to your~/.zshrcor usebrew services start ollama.
Note: For Ollama, use
--dimension 768when creating collections.
Amazon Bedrock Setup (AWS/Kiro Subscription)
Uses your existing AWS credentials - no secrets stored in code.
# 1. Ensure AWS CLI is configured (uses ~/.aws/credentials)
aws configure # Or set AWS_PROFILE for specific profile
# 2. Install boto3 if not present
pip install boto3
# 3. Set environment variables
export EMBEDDING_PROVIDER=bedrock
export AWS_REGION=eu-west-1 # Default region
# 4. Test authentication
python3 skills/qdrant-memory/scripts/embedding_utils.py
Models Available (cheapest first):
| Model | Dimensions | Pricing |
|---|---|---|
amazon.titan-embed-text-v2:0 |
1024 | ~$0.02/1M tokens |
amazon.titan-embed-text-v1 |
1536 | ~$0.02/1M tokens |
cohere.embed-english-v3 |
1024 | ~$0.10/1M tokens |
Note: For Bedrock Titan V2, use
--dimension 1024when creating collections.
OpenAI Setup (Cloud)
export OPENAI_API_KEY="sk-..."
Quick Start
MCP Server Configuration
{
"qdrant-mcp": {
"command": "npx",
"args": ["-y", "@qdrant/mcp-server-qdrant"],
"env": {
"QDRANT_URL": "http://localhost:6333",
"QDRANT_API_KEY": "${QDRANT_API_KEY}",
"COLLECTION_NAME": "agent_memory"
}
}
}
Initialize Memory Collection
Run scripts/init_collection.py to create the optimized collection:
# For Ollama (nomic-embed-text - 768 dimensions)
python3 scripts/init_collection.py --collection agent_memory --dimension 768
# For OpenAI (text-embedding-3-sm
Установить qdrant-memory в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл qdrant-memory?
Intelligent token optimization through Qdrant-powered semantic caching and long-term memory. Use for (1) Semantic Cache - avoid LLM calls entirely for semantically similar queries with 100% token savings, (2) Long-Term Memory - retrieve only relevant context chunks instead of full conversation history with 80-95% context reduction, (3) Hybrid Search - combine vector similarity with keyword filtering for technical queries, (4) Memory Management - store and retrieve conversation memories, decisions, and code patterns with metadata filtering. Triggers when needing to cache responses, remember past interactions, optimize context windows, or implement RAG patterns.
Как установить скилл qdrant-memory?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл qdrant-memory запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic