File size: 2,168 Bytes
f7621c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dc43225
f7621c2
 
 
 
 
 
 
 
 
 
 
 
dc43225
f7621c2
dc43225
f7621c2
 
 
a2f30b6
f7621c2
 
 
 
 
 
 
 
 
 
 
 
 
 
78cfc97
f7621c2
6984e8f
f7621c2
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: cc-by-3.0
task_categories:
- question-answering
language:
- en
tags:
- vector search
- retrieval augmented generation
size_categories:
- <1K
---

## Overview

This dataset consists of chunked and embedded versions of a small subset of MongoDB's technical documentation. It contains 795 chunks from 498 documentation pages, sampled from 50 documentation sources.

## Dataset Structure

The dataset consists of the following fields:

- chunk_id: Unique identifier for the chunk.
- page_id: Identifier of the documentation page the chunk came from.
- source_name: The documentation source, such as `pymongo` or `atlas-cli`.
- product_name: The product the page documents, when available.
- url: Link to the documentation page.
- title: Title of the documentation page.
- text: Content of the chunk in Markdown format.
- embedding: The embedding of the chunk's content, created using Voyage AI's [voyage-4-large](https://www.mongodb.com/docs/voyageai/models/text-embeddings/) model with 1024 dimensions and `input_type="document"`.

Pages were split into chunks of up to ~2,000 tokens at Markdown heading boundaries. Because the Voyage 4 models share an embedding space, you can embed queries for this dataset with `voyage-4-large`, `voyage-4`, or `voyage-4-lite`.

## Usage

This dataset can be useful for prototyping RAG applications. It is derived from [mongodb-eai/docs](https://huggingface.co/datasets/mongodb-eai/docs).

## Ingest Data

To experiment with this dataset using MongoDB Atlas, first [create a MongoDB Atlas account](https://www.mongodb.com/cloud/atlas/register?utm_campaign=devrel&utm_source=community&utm_medium=organic_social&utm_content=Hugging%20Face%20Dataset&utm_term=apoorva.joshi).

You can then use the following script to load this dataset into your MongoDB Atlas cluster:

```python
import os

from datasets import load_dataset
from pymongo import MongoClient

client = MongoClient(os.environ["MONGODB_URI"])
collection = client["your_database_name"]["mongodb_docs"]

dataset = load_dataset("MongoDB/mongodb-docs-chunked", split="train")
collection.insert_many(dataset.to_list())

print(f"Ingested {len(dataset)} documents")
```