{
 "_published": {
  "source": "docs/measurements/rag-qdrant-walkthrough-2026-11-15.json",
  "published": "2026-11-15",
  "publisher": "J4SGON S.L., vorluxai.com",
  "index": "https://vorluxai.com/data/",
  "cleaned": "Copied from our internal repository by scripts/publish_measurements.py. Every number is unchanged. Redacted: private IP addresses -> <prime> / <second-box> / <private-ip> (1). Hostnames (spark-43d5, spark-7180) and the PRIME / spark2 labels are kept: the posts use them.",
  "redactions": {
   "private_ip": 1
  }
 },
 "title": "Local RAG walkthrough: Ollama /api/embed, Qdrant and a small chat model, one run",
 "date": "2026-11-15",
 "started_at": "2026-11-15T20:26:43+00:00",
 "label": "embeddings and chat on spark2 (spark-7180), Ollama 0.34.0, OLLAMA_NUM_PARALLEL=8; throwaway Qdrant container on spark-43d5; reranker already resident on spark-43d5",
 "command": "python3 scripts/bench/rag_qdrant_walkthrough.py --ollama http://<second-box>:11434 --qdrant http://localhost:6399 --llm llama3.1:8b --reranker http://localhost:8201 --label embeddings and chat on spark2 (spark-7180), Ollama 0.34.0, OLLAMA_NUM_PARALLEL=8; throwaway Qdrant container on spark-43d5; reranker already resident on spark-43d5 --out docs/measurements/rag-qdrant-walkthrough-2026-11-15.json",
 "method": "A walkthrough, not a benchmark: six hand-written Spanish documents, the tutorial script as printed in the posts, one run each. The Qdrant instance was an empty throwaway container; every collection created here was deleted at the end. Models were called with keep_alive 0.",
 "qdrant": {
  "title": "qdrant - vector search engine",
  "version": "1.18.2",
  "commit": "44ad62f8cd69642be5afa6441612525e24a0d063"
 },
 "ollama_version": "0.34.0",
 "llm": "llama3.1:8b",
 "embed_model": "bge-m3",
 "script": {
  "path": "evals/rag-qdrant-walkthrough/rag_local.py",
  "sha256": "ae1795d81de74a85d3d844217eb363c5d7267cd9b38542eb5af198d4bde0df2f",
  "lines": 63,
  "env": {
   "OLLAMA": "<--ollama>",
   "QDRANT": "<--qdrant>",
   "LLM": "llama3.1:8b",
   "KEEP_ALIVE": "0"
  }
 },
 "documents": {
  "dir": "evals/rag-qdrant-walkthrough/docs",
  "files": 6,
  "characters": {
   "copias-seguridad.md": 375,
   "gastos.md": 449,
   "impresora.md": 407,
   "incorporaciones.md": 426,
   "teletrabajo.md": 384,
   "vacaciones.md": 501
  }
 },
 "resident_before": [
  "gemma4-32k:latest",
  "qwen3.6:35b"
 ],
 "embed_probe": {
  "request": {
   "model": "bge-m3",
   "input": [
    "Las vacaciones se piden con quince días de antelación.",
    "¿Cuántos días de vacaciones tengo?"
   ],
   "truncate": false,
   "keep_alive": 0
  },
  "response_keys": [
   "embeddings",
   "load_duration",
   "model",
   "prompt_eval_count",
   "total_duration"
  ],
  "vectors": 2,
  "dimension": 1024,
  "first_values": [
   -0.024,
   0.0085,
   -0.0421,
   -0.0033
  ],
  "l2_norm": 1.0,
  "cosine_between_the_two": 0.6932,
  "prompt_eval_count": 27
 },
 "ingest": {
  "args": [
   "ingest",
   "evals/rag-qdrant-walkthrough/docs"
  ],
  "exit_code": 0,
  "stdout": "copias-seguridad 1\ngastos 1\nimpresora 1\nincorporaciones 1\nteletrabajo 1\nvacaciones 1",
  "stderr": ""
 },
 "collection_after_ingest": {
  "status": "green",
  "points_count": 6,
  "vectors": {
   "size": 1024,
   "distance": "Cosine"
  },
  "payload_schema": {
   "doc": {
    "data_type": "keyword",
    "points": 6
   }
  }
 },
 "ingest_again": {
  "args": [
   "ingest",
   "evals/rag-qdrant-walkthrough/docs"
  ],
  "exit_code": 0,
  "stdout": "copias-seguridad 1\ngastos 1\nimpresora 1\nincorporaciones 1\nteletrabajo 1\nvacaciones 1",
  "stderr": ""
 },
 "points_after_second_ingest": 6,
 "ask": [
  {
   "question": "¿Cuánto me pagan por kilómetro si voy con mi coche?",
   "args": [
    "ask",
    "¿Cuánto me pagan por kilómetro si voy con mi coche?"
   ],
   "exit_code": 0,
   "stdout": "[1] 0,26 euros por kilómetro. \n\n[1] gastos#0  score 0.648\n[2] vacaciones#0  score 0.382\n[3] teletrabajo#0  score 0.371\n[4] incorporaciones#0  score 0.351\n[5] copias-seguridad#0  score 0.321",
   "stderr": ""
  },
  {
   "question": "¿Qué hago si la impresora muestra E-204?",
   "args": [
    "ask",
    "¿Qué hago si la impresora muestra E-204?"
   ],
   "exit_code": 0,
   "stdout": "[1] Abre la bandeja lateral y saca el papel atascado antes de reiniciarla. \n\n[1] impresora#0  score 0.603\n[2] incorporaciones#0  score 0.366\n[3] teletrabajo#0  score 0.357\n[4] copias-seguridad#0  score 0.347\n[5] gastos#0  score 0.341",
   "stderr": ""
  },
  {
   "question": "¿Cuál es el horario del comedor?",
   "args": [
    "ask",
    "¿Cuál es el horario del comedor?"
   ],
   "exit_code": 0,
   "stdout": "No lo sé. \n\n[1] teletrabajo#0  score 0.447\n[2] gastos#0  score 0.438\n[3] vacaciones#0  score 0.416\n[4] copias-seguridad#0  score 0.404\n[5] incorporaciones#0  score 0.375",
   "stderr": ""
  }
 ],
 "errors": {
  "upsert_wrong_dimension": {
   "status": 400,
   "body": {
    "status": {
     "error": "Wrong input: Vector dimension error: expected dim: 1024, got 768"
    },
    "time": 1.1232e-05
   }
  },
  "query_wrong_dimension": {
   "status": 400,
   "body": {
    "status": {
     "error": "Wrong input: Vector dimension error: expected dim: 1024, got 768"
    },
    "time": 0.000422116
   }
  },
  "query_missing_collection": {
   "status": 404,
   "body": {
    "status": {
     "error": "Not found: Collection `nope` doesn't exist!"
    },
    "time": 3.472e-06
   }
  },
  "create_existing_collection": {
   "status": 409,
   "body": {
    "status": {
     "error": "Wrong input: Collection `docs` already exists!"
    },
    "time": 2.264e-05
   }
  },
  "ollama_unknown_model": {
   "status": 404,
   "body": {
    "error": "model \"no-such-model\" not found, try pulling it first"
   }
  },
  "embed_12000_words_truncate_false": {
   "status": 400,
   "body": {
    "error": "the input length exceeds the context length"
   }
  },
  "embed_12000_words_default": {
   "status": 200,
   "returned_an_embedding": true,
   "prompt_eval_count": 2048
  }
 },
 "context_probe": {
  "declared_context_length": 8192,
  "runs": [
   {
    "words": 2046,
    "options": {},
    "result": "ok, prompt_eval_count 2048"
   },
   {
    "words": 2047,
    "options": {},
    "result": "the input length exceeds the context length"
   },
   {
    "words": 3000,
    "options": {
     "num_ctx": 8192
    },
    "result": "the input length exceeds the context length"
   },
   {
    "words": 3000,
    "options": {
     "num_ctx": 8192,
     "num_batch": 8192
    },
    "result": "ok, prompt_eval_count 3002"
   }
  ]
 },
 "delete_by_filter": {
  "request": {
   "filter": {
    "must": [
     {
      "key": "doc",
      "match": {
       "value": "impresora"
      }
     }
    ]
   }
  },
  "count_before": {
   "count": 1
  },
  "delete": {
   "status": 200,
   "body": {
    "result": {
     "operation_id": 27,
     "status": "completed"
    },
    "status": "ok",
    "time": 0.001156859
   }
  },
  "count_after": {
   "count": 0
  },
  "points_left": 5
 },
 "alias_switch": {
  "create_alias": {
   "status": 200,
   "body": {
    "result": true,
    "status": "ok",
    "time": 0.010462876
   }
  },
  "create_docs_v2": {
   "status": 200,
   "body": {
    "result": true,
    "status": "ok",
    "time": 0.145368427
   }
  },
  "switch_request": {
   "actions": [
    {
     "delete_alias": {
      "alias_name": "docs_live"
     }
    },
    {
     "create_alias": {
      "collection_name": "docs_v2",
      "alias_name": "docs_live"
     }
    }
   ]
  },
  "switch": {
   "status": 200,
   "body": {
    "result": true,
    "status": "ok",
    "time": 0.017861037
   }
  },
  "aliases_after": {
   "aliases": [
    {
     "alias_name": "docs_live",
     "collection_name": "docs_v2"
    }
   ]
  }
 },
 "hybrid": {
  "create_request": {
   "vectors": {
    "dense": {
     "size": 1024,
     "distance": "Cosine"
    }
   },
   "sparse_vectors": {
    "bm25": {
     "modifier": "idf"
    }
   }
  },
  "create": {
   "status": 200,
   "body": {
    "result": true,
    "status": "ok",
    "time": 0.166465109
   }
  },
  "upsert": {
   "status": 200,
   "body": {
    "result": {
     "operation_id": 1,
     "status": "completed"
    },
    "status": "ok",
    "time": 0.006700123
   }
  },
  "point_shape": {
   "id": 1,
   "vector": {
    "dense": "<1024 floats>",
    "bm25": {
     "text": "<document text>",
     "model": "qdrant/bm25",
     "options": {
      "language": "spanish"
     }
    }
   },
   "payload": {
    "doc": "copias-seguridad"
   }
  },
  "questions": [
   {
    "question": "¿Qué significa el código E-204?",
    "dense": [
     [
      "impresora",
      0.36
     ],
     [
      "gastos",
      0.261
     ],
     [
      "copias-seguridad",
      0.257
     ]
    ],
    "bm25": [
     [
      "impresora",
      4.682
     ]
    ],
    "rrf_k60": [
     [
      "impresora",
      0.033
     ],
     [
      "gastos",
      0.016
     ],
     [
      "copias-seguridad",
      0.016
     ]
    ]
   },
   {
    "question": "¿Dónde se guarda la copia semanal?",
    "dense": [
     [
      "copias-seguridad",
      0.646
     ],
     [
      "teletrabajo",
      0.48
     ],
     [
      "incorporaciones",
      0.43
     ]
    ],
    "bm25": [
     [
      "copias-seguridad",
      5.935
     ],
     [
      "teletrabajo",
      1.6
     ],
     [
      "incorporaciones",
      1.572
     ]
    ],
    "rrf_k60": [
     [
      "copias-seguridad",
      0.033
     ],
     [
      "teletrabajo",
      0.033
     ],
     [
      "incorporaciones",
      0.032
     ]
    ]
   },
   {
    "question": "vacación",
    "dense": [
     [
      "vacaciones",
      0.552
     ],
     [
      "teletrabajo",
      0.435
     ],
     [
      "incorporaciones",
      0.426
     ]
    ],
    "bm25": [
     [
      "vacaciones",
      2.742
     ]
    ],
    "rrf_k60": [
     [
      "vacaciones",
      0.033
     ],
     [
      "teletrabajo",
      0.016
     ],
     [
      "incorporaciones",
      0.016
     ]
    ]
   },
   {
    "question": "¿Puedo trabajar desde casa los martes?",
    "dense": [
     [
      "teletrabajo",
      0.667
     ],
     [
      "vacaciones",
      0.47
     ],
     [
      "incorporaciones",
      0.412
     ]
    ],
    "bm25": [
     [
      "teletrabajo",
      9.573
     ]
    ],
    "rrf_k60": [
     [
      "teletrabajo",
      0.033
     ],
     [
      "vacaciones",
      0.016
     ],
     [
      "incorporaciones",
      0.016
     ]
    ]
   }
  ],
  "rrf_request_shape": {
   "prefetch": [
    {
     "query": "<1024 floats>",
     "using": "dense",
     "limit": 20
    },
    {
     "query": {
      "text": "<question>",
      "model": "qdrant/bm25",
      "options": {
       "language": "spanish"
      }
     },
     "using": "bm25",
     "limit": 20
    }
   ],
   "query": {
    "rrf": {
     "k": 60
    }
   },
   "limit": 3,
   "with_payload": true
  },
  "bm25_vacacion_language_english": [],
  "delete": {
   "status": 200,
   "body": {
    "result": true,
    "status": "ok",
    "time": 0.007027437
   }
  }
 },
 "dimensions_field": {
  "bge-m3": {
   "requested": 256,
   "returned": 256,
   "l2_norm": 1.0
  },
  "nomic-embed-text": {
   "requested": 256,
   "returned": 256,
   "l2_norm": 1.0
  },
  "embeddinggemma": {
   "requested": 256,
   "returned": 256,
   "l2_norm": 1.0
  }
 },
 "compare_embeddings": {
  "script": {
   "path": "evals/rag-qdrant-walkthrough/compare_embeddings.py",
   "sha256": "b11be16295a7ca802c1b287db64f7424c53fcf22bcf61810722e78cc7c24ea59",
   "lines": 39
  },
  "questions": "evals/rag-qdrant-walkthrough/questions.json",
  "note": "six documents and eight easy questions: this shows the output format, it does not rank the models",
  "args": [
   "evals/rag-qdrant-walkthrough/docs",
   "evals/rag-qdrant-walkthrough/questions.json"
  ],
  "exit_code": 0,
  "stdout": "6 fragmentos, 8 preguntas\nbge-m3             dim 1024  hit@1 8/8  hit@5 8/8  MRR@10 1.000\nnomic-embed-text   dim  768  hit@1 8/8  hit@5 8/8  MRR@10 1.000\nembeddinggemma     dim  768  hit@1 8/8  hit@5 8/8  MRR@10 1.000",
  "stderr": ""
 },
 "rerank_probe": {
  "served_model": "BAAI/bge-reranker-v2-m3",
  "request": {
   "model": "reranker",
   "query": "¿Cuánto me pagan por kilómetro si voy con mi coche?",
   "top_n": 3,
   "documents": [
    "Cada persona de la oficina tiene 23 días laborables de vacaciones al año.",
    "El kilometraje con coche propio se paga a 0,26 euros por kilómetro.",
    "Los martes son presenciales para todo el mundo."
   ]
  },
  "results": [
   {
    "index": 1,
    "relevance_score": 0.9920145273208618
   },
   {
    "index": 2,
    "relevance_score": 1.6366697309422307e-05
   },
   {
    "index": 0,
    "relevance_score": 1.6134808902279474e-05
   }
  ]
 },
 "derived": {
  "source": "docs/measurements/rag-embeddings-es-2026-11-02.json",
  "note": "document-level ranks; a question counts as moved when the first gold document changes position",
  "reranker_vs_embeddings_bge_m3": {
   "500": {
    "n": 60,
    "first_place_gained": 5,
    "first_place_lost": 4,
    "first_place_sign_test_p": 1.0,
    "gold_moved_up": 6,
    "gold_moved_down": 5,
    "gold_same": 49,
    "position_sign_test_p": 1.0
   },
   "1000": {
    "n": 60,
    "first_place_gained": 7,
    "first_place_lost": 1,
    "first_place_sign_test_p": 0.0703,
    "gold_moved_up": 12,
    "gold_moved_down": 2,
    "gold_same": 46,
    "position_sign_test_p": 0.0129
   },
   "2000": {
    "n": 60,
    "first_place_gained": 4,
    "first_place_lost": 0,
    "first_place_sign_test_p": 0.125,
    "gold_moved_up": 7,
    "gold_moved_down": 1,
    "gold_same": 52,
    "position_sign_test_p": 0.0703
   }
  },
  "embeddinggemma_vs_bge_m3": {
   "500": {
    "n": 60,
    "first_place_gained": 3,
    "first_place_lost": 3,
    "first_place_sign_test_p": 1.0,
    "gold_moved_up": 5,
    "gold_moved_down": 6,
    "gold_same": 49,
    "position_sign_test_p": 1.0
   },
   "1000": {
    "n": 60,
    "first_place_gained": 6,
    "first_place_lost": 3,
    "first_place_sign_test_p": 0.5078,
    "gold_moved_up": 12,
    "gold_moved_down": 3,
    "gold_same": 45,
    "position_sign_test_p": 0.0352
   },
   "2000": {
    "n": 60,
    "first_place_gained": 4,
    "first_place_lost": 2,
    "first_place_sign_test_p": 0.6875,
    "gold_moved_up": 6,
    "gold_moved_down": 5,
    "gold_same": 49,
    "position_sign_test_p": 1.0
   }
  }
 },
 "cleanup": {
  "docs": true,
  "docs_v2": true
 },
 "collections_left": [],
 "resident_after": [
  "gemma4-32k:latest",
  "qwen3.6:35b"
 ],
 "finished_at": "2026-11-15T20:28:02+00:00"
}
