{"id":28493366,"url":"https://github.com/qdrant/dspy-qdrant","last_synced_at":"2026-02-27T13:42:08.317Z","repository":{"id":289853532,"uuid":"972610241","full_name":"qdrant/dspy-qdrant","owner":"qdrant","description":"Qdrant powered retriever module for DSPy","archived":false,"fork":false,"pushed_at":"2025-12-19T04:44:46.000Z","size":134,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-21T04:11:52.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qdrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-25T11:08:17.000Z","updated_at":"2026-01-28T01:37:35.000Z","dependencies_parsed_at":"2025-04-25T12:35:08.162Z","dependency_job_id":null,"html_url":"https://github.com/qdrant/dspy-qdrant","commit_stats":null,"previous_names":["qdrant/dspy-qdrant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qdrant/dspy-qdrant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fdspy-qdrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fdspy-qdrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fdspy-qdrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fdspy-qdrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qdrant","download_url":"https://codeload.github.com/qdrant/dspy-qdrant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fdspy-qdrant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29898179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T12:09:13.686Z","status":"ssl_error","status_checked_at":"2026-02-27T12:09:13.282Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T09:08:33.844Z","updated_at":"2026-02-27T13:42:08.303Z","avatar_url":"https://github.com/qdrant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSPy-Qdrant\n\n[Qdrant](https://qdrant.tech/) powered custom retriever module for [DSPy](https://dspy.ai).\n\n## Installation\n\n```bash\npip install dspy-qdrant\n```\n\n## Usage\n\n```python\nfrom dspy_qdrant import QdrantRM\n```\n\nThe `QdrantRM` class enables semantic search by retrieving the top-k most relevant documents from a Qdrant collection using a sentence embedding model.\n\n### Parameters\n\n| Name                 | Type                      | Description                                                                                  | Default                     |\n|----------------------|---------------------------|----------------------------------------------------------------------------------------------|-----------------------------|\n| `qdrant_collection_name` | `str`                    | Name of the Qdrant collection used for retrieval.                                             | **Required**                |\n| `qdrant_client`         | `QdrantClient`            | An initialized instance of `qdrant_client.QdrantClient`.                                      | **Required**                |\n| `k`                    | `int`                     | Number of top documents to retrieve per query.                                                | `3`                         |\n| `document_field`       | `str`                     | Field in the Qdrant payload that contains the raw document content.                           | `\"document\"`                |\n| `vectorizer`           | `BaseSentenceVectorizer`  | Embedding model for vectorizing queries. Uses `FastEmbedVectorizer` if not provided.          | `None`                      |\n| `vector_name`          | `str`                     | Name of the vector field in Qdrant collection to use for search. Defaults to the first found. | `None`                      |\n\n### Use in a Module's `forward()` Function\n\n```python\nimport dspy\n\nfrom qdrant_client import QdrantClient\nfrom dspy_qdrant import QdrantRM\n\nqdrant_client = QdrantClient()\n\nclass MyModule(dspy.Module):\n    def __init__(self, num_passages: int = 5):\n        super().__init__()\n        self.num_passages = num_passages\n\n    def forward(self, question: str):\n        retrieve = QdrantRM(\n            qdrant_collection_name=\"my_collection_name\",\n            qdrant_client=qdrant_client,\n            k=self.num_passages\n        )\n        # Do something with results...\n```\n\n## 📚 See Also\n\n- [Qdrant Documentation](https://qdrant.tech/documentation/)\n- [DSPy GitHub](https://github.com/stanfordnlp/dspy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fdspy-qdrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqdrant%2Fdspy-qdrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fdspy-qdrant/lists"}