{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 21,\n \"parent_id\": 16,\n \"slug\": \"ki-embedding\",\n \"path\": \"\/ki-system\/ki-embedding\",\n \"title\": \"Embedding\",\n \"description\": \"Vektorerzeugung für semantische Suche und RAG.\",\n \"content\": \"<nav class=\\\"breadcrumb\\\">\\n <a href=\\\"\/docs\\\">Dokumentation<\/a> » <a href=\\\"\/docs\/ki-system\\\">KI-System<\/a> » Embedding\\n<\/nav>\\n\\n<h1>Embedding<\/h1>\\n<p class=\\\"doc-meta\\\"><strong>Erstellt:<\/strong> 2025-12-20 | <strong>Aktualisiert:<\/strong> 2025-12-20<\/p>\\n\\n<p>Vektorerzeugung für semantische Suche und RAG.<\/p>\\n\\n<table>\\n <tr><th>Model<\/th><td>mxbai-embed-large<\/td><\/tr>\\n <tr><th>Dimensionen<\/th><td>1024<\/td><\/tr>\\n <tr><th>Provider<\/th><td>Ollama (lokal)<\/td><\/tr>\\n <tr><th>Fallback<\/th><td>OpenAI (optional)<\/td><\/tr>\\n<\/table>\\n\\n<h2>Qdrant Collections<\/h2>\\n<table>\\n <tr><th>Collection<\/th><th>Zweck<\/th><th>Dimensionen<\/th><\/tr>\\n <tr><td>documents<\/td><td>Dokument-Chunks<\/td><td>1024<\/td><\/tr>\\n <tr><td>mail<\/td><td>E-Mail-Inhalte<\/td><td>1024<\/td><\/tr>\\n <tr><td>entities<\/td><td>Entitäten-Embeddings<\/td><td>1024<\/td><\/tr>\\n<\/table>\\n\\n<h2>Qdrant-Konfiguration<\/h2>\\n<pre><code>{\\n \\\"vectors\\\": {\\n \\\"size\\\": 1024,\\n \\\"distance\\\": \\\"Cosine\\\"\\n },\\n \\\"hnsw_config\\\": {\\n \\\"m\\\": 16,\\n \\\"ef_construct\\\": 100\\n }\\n}<\/code><\/pre>\\n\\n<h2>Model installieren<\/h2>\\n<pre><code>ollama pull mxbai-embed-large\\nollama list<\/code><\/pre>\\n\\n<h2>API-Aufruf<\/h2>\\n<pre><code>curl http:\/\/localhost:11434\/api\/embeddings -d '{\\n \\\"model\\\": \\\"mxbai-embed-large\\\",\\n \\\"prompt\\\": \\\"Text zum Embedden\\\"\\n}'<\/code><\/pre>\\n\\n<h2>Python-Integration<\/h2>\\n<pre><code>import requests\\n\\ndef get_embedding(text: str) -> list[float]:\\n response = requests.post(\\n 'http:\/\/localhost:11434\/api\/embeddings',\\n json={\\n 'model': 'mxbai-embed-large',\\n 'prompt': text\\n }\\n )\\n return response.json()['embedding']<\/code><\/pre>\\n\\n<h2>Qdrant-Speicherung<\/h2>\\n<pre><code>from qdrant_client import QdrantClient\\nfrom qdrant_client.models import PointStruct\\n\\nclient = QdrantClient(host=\\\"localhost\\\", port=6333)\\n\\nclient.upsert(\\n collection_name=\\\"documents\\\",\\n points=[\\n PointStruct(\\n id=uuid4().hex,\\n vector=embedding,\\n payload={\\n \\\"document_id\\\": 123,\\n \\\"chunk_id\\\": 1,\\n \\\"content_preview\\\": text[:200]\\n }\\n )\\n ]\\n)<\/code><\/pre>\",\n \"status\": \"published\",\n \"sort_order\": 5,\n \"depth\": 1,\n \"created_at\": \"2025-12-20T11:13:58\",\n \"updated_at\": \"2025-12-27T15:58:19\"\n }\n}"
}
]
}