Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: dsRAG integration #1227

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions qdrant-landing/content/documentation/frameworks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ partition: build
| [CrewAI](/documentation/frameworks/crewai/) | CrewAI is a framework to build automated workflows using multiple AI agents that perform complex tasks. |
| [DocArray](/documentation/frameworks/docarray/) | Python library for managing data in multi-modal AI applications. |
| [DSPy](/documentation/frameworks/dspy/) | Framework for algorithmically optimizing LM prompts and weights. |
| [dsRAG](/documentation/frameworks/dsrag/) | High-performance Python retrieval engine for unstructured data. |
| [Feast](/documentation/frameworks/feast/) | Open-source feature store to operate production ML systems at scale as a set of features. |
| [Fifty-One](/documentation/frameworks/fifty-one/) | Toolkit for building high-quality datasets and computer vision models. |
| [Genkit](/documentation/frameworks/genkit/) | Framework to build, deploy, and monitor production-ready AI-powered apps. |
Expand Down
50 changes: 50 additions & 0 deletions qdrant-landing/content/documentation/frameworks/dsrag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: dsRAG
---

# dsRAG

[dsRAG](https://github.com/D-Star-AI/dsRAG) is a retrieval engine for unstructured data. It is especially good at handling challenging queries over dense text, like financial reports, legal documents, and academic papers. dsRAG achieves substantially higher accuracy than vanilla RAG baselines on complex open-book question answering tasks

You can use the Qdrant connector in dsRAG to add and semantically retrieve documents from your collections.

## Usage Example

```python
from dsrag.database.vector import QdrantVectorDB
import numpy as np
from qdrant_clien import models

db = QdrantVectorDB(kb_id=self.kb_id, url="http://localhost:6334", prefer_grpc=True)
vectors = [np.array([1, 0]), np.array([0, 1])]

# You can use any document loaders available with dsRAG
# We'll use literals for demonstration
documents = [
{
"doc_id": "1",
"chunk_index": 0,
"chunk_header": "Header1",
"chunk_text": "Text1",
},
{
"doc_id": "2",
"chunk_index": 1,
"chunk_header": "Header2",
"chunk_text": "Text2",
},
]

db.add_vectors(vectors, documents)

metadata_filter = models.Filter(
must=[models.FieldCondition(key="doc_id", match=models.MatchValue(value="1"))]
)

db.search(query_vector, top_k=4, metadata_filter=metadata_filter)
```

## Further Reading

- [dsRAG Source](https://github.com/D-Star-AI/dsRAG).
- [dsRAG Examples](https://github.com/D-Star-AI/dsRAG/tree/main/examples)