-
Notifications
You must be signed in to change notification settings - Fork 51
DOCSP-48385 Make Atlas Vector Search page #1042
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
Changes from 8 commits
de35100
16b076f
ad02335
d0861ae
eb3d638
352b609
5a9c66b
4c70a5a
7031ae8
c8547d5
bab15fc
7518048
0cb7f04
75c9ecb
b1481a4
d0d6e7d
ddff046
d0627a6
9489bdf
a592593
2a8876d
4533009
a593d9d
2598b4e
5738a01
3e491d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,120 @@ | ||||||||||||
.. _node-atlas-vector-search: | ||||||||||||
|
||||||||||||
=================== | ||||||||||||
Atlas Vector Search | ||||||||||||
=================== | ||||||||||||
|
||||||||||||
.. facet:: | ||||||||||||
:name: genre | ||||||||||||
:values: reference | ||||||||||||
|
||||||||||||
.. meta:: | ||||||||||||
:keywords: code example, semantic, nearest | ||||||||||||
|
||||||||||||
.. contents:: On this page | ||||||||||||
:local: | ||||||||||||
:backlinks: none | ||||||||||||
:depth: 2 | ||||||||||||
:class: singlecol | ||||||||||||
|
||||||||||||
Overview | ||||||||||||
-------- | ||||||||||||
|
||||||||||||
In this guide, you can learn how to use the :atlas:`Atlas Vector Search | ||||||||||||
</atlas-vector-search/vector-search-overview/>` feature | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Remove the link here since there is a "learn more" at bottom of the section |
||||||||||||
in the {+driver-short+}. | ||||||||||||
|
||||||||||||
You can use {+vector-search+} to perform vector search on your data stored in | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
Atlas. Vector search allows you to query your data based on semantic meaning | ||||||||||||
rather than just keyword matches, which helps you retrieve more relevant search | ||||||||||||
results. It enables your AI-powered applications to support use cases such as | ||||||||||||
semantic search, hybrid search, and generative search, including | ||||||||||||
Retrieval-Augmented Generation (RAG). | ||||||||||||
|
||||||||||||
By using Atlas as a vector database, you can seamlessly index vector data along | ||||||||||||
with your other data in Atlas. This allows you to filter on fields in your | ||||||||||||
collection and perform vector search queries against vector data. You can also | ||||||||||||
combine vector search with full-text search queries to return the most relevant | ||||||||||||
results for your use case. You can integrate {+vector-search+} with popular AI | ||||||||||||
frameworks and services to implement vector search in your applications. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: I would include only one paragraph of background text. The link to the Atlas Vector Search will be useful for those who want to learn more. I would keep the first paragraph and remove the 2nd paragraph entirely, or integrate some of the content from the 2nd paragraph into the first if you think necessary. |
||||||||||||
|
||||||||||||
To learn more about {+vector-search+}, see the :atlas:`{+vector-search+} | ||||||||||||
</atlas-vector-search/vector-search-overview/>` guide in the MongoDB Atlas | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
documentation. | ||||||||||||
|
||||||||||||
.. important:: Feature Compatibility | ||||||||||||
|
||||||||||||
To learn what versions of MongoDB Atlas support this feature, see | ||||||||||||
:atlas:`Limitations </atlas-vector-search/vector-search-stage/#limitations>` | ||||||||||||
in the MongoDB Atlas documentation. | ||||||||||||
|
||||||||||||
Perform a Vector Search | ||||||||||||
----------------------- | ||||||||||||
|
||||||||||||
To use this feature, you must create a vector search index and index your | ||||||||||||
vector embeddings. To learn about how to programmatically create a | ||||||||||||
vector search index, see the :ref:`node-indexes` section in the | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I: There is currently no documentation for creating AVS indexes in the Node.js docs on the linked page. Something like this section in the Go docs should be created: https://www.mongodb.com/docs/drivers/go/current/fundamentals/indexes/#atlas-search-and-atlas-vector-search-indexes. If you choose to create another ticket for adding the section to the indexes page, I would link to this section on creating AVS indexes in the Atlas docs: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#create-an-atlas-vector-search-index There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll create a new ticket! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can drop a link here when you do! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
Indexes guide. To learn more about vector embeddings, see | ||||||||||||
:atlas:`How to Index Vector Embeddings for Vector Search | ||||||||||||
</atlas-search/field-types/knn-vector/>` in the Atlas documentation. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I: It seems like this page has deprecated info now. This is the relevant embedding page for Atlas Vector Search: https://www.mongodb.com/docs/atlas/atlas-vector-search/create-embeddings/ |
||||||||||||
|
||||||||||||
After you create a vector search index on your vector embeddings, you | ||||||||||||
can reference this index in your pipeline stage, as shown in the | ||||||||||||
following section. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Since Sample Data is now the next section |
||||||||||||
|
||||||||||||
Vector Search Example | ||||||||||||
~~~~~~~~~~~~~~~~~~~~~ | ||||||||||||
|
||||||||||||
You can perform a vector search query by using the ``$vectorSearch`` stage | ||||||||||||
in an :ref:`aggregation pipeline <node-aggregation>`. To perform a vector | ||||||||||||
search on a collection, you must first have a collection with a field that contains | ||||||||||||
vector data and a vector search index that covers that field. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: I think using "embeddings" is the more specific term. |
||||||||||||
|
||||||||||||
.. tip:: | ||||||||||||
|
||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Include the type of search |
||||||||||||
To learn more about configuring a collection for vector search, see the :atlas:`{+vector-search+} | ||||||||||||
</atlas-vector-search/vector-search-overview/>` guide in the MongoDB Atlas | ||||||||||||
documentation. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: I would remove this tip, as creating vector embeddings was discussed in the intro. This is all you need to do to configure the collection. |
||||||||||||
|
||||||||||||
This example shows how to build an aggregation pipeline that uses the | ||||||||||||
``$vectorSearch`` stage to perform an exact vector search on the | ||||||||||||
``sample_mflix.embedded_movies`` collection in the :atlas:`Atlas sample datasets </sample-data>`. | ||||||||||||
To learn how to create a free MongoDB Atlas cluster and load the sample datasets, see the | ||||||||||||
:atlas:`Get Started with Atlas </getting-started>` guide. The aggregation | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: This info is a bit crowded here. I would include this info in a Sample Data section, like on this Go page: https://www.mongodb.com/docs/drivers/go/current/fundamentals/atlas-vector-search/#sample-data |
||||||||||||
pipeline searches for documents that include text in the ``plot`` field that is | ||||||||||||
semantically related to the term "time travel". The ``queryVector`` field in the | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Reword for clarity |
||||||||||||
``$vectorSearch`` pipeline is the vector representation of your query. | ||||||||||||
|
||||||||||||
.. literalinclude:: /includes/aggregation/atlas-vector-search-example.js | ||||||||||||
:language: javascript | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: Can you include the output of this query? Here's an example: https://github.com/mongodb/docs-golang/blob/f1acd71cf1f37331a220d133feec2804c8ab54ce/source/fundamentals/atlas-vector-search.txt#L128 |
||||||||||||
|
||||||||||||
This query uses the ``$vectorSearch`` stage to: | ||||||||||||
|
||||||||||||
- Compare vector embeddings of the search term against vector embeddings of movie plots in | ||||||||||||
the ``plot_embedding`` field of the ``sample_mflix.embedded_movies`` collection. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Don't think using the technical explanation is necessary here, as it was already explained above. |
||||||||||||
|
||||||||||||
- Consider up to the 150 most similar movie plots and return the top 10 results. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Would explicitly include what |
||||||||||||
|
||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Add a description of what |
||||||||||||
It uses the ``$project`` stage to: | ||||||||||||
|
||||||||||||
- Only include the movie plot and title fields in the results. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
- Add a score field to show the relevance of each result to the search term. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Monospace is helpful here, so users know they can reference that variable in the code when reading your explanation. |
||||||||||||
|
||||||||||||
.. tip:: {+language+} Vector Search Examples | ||||||||||||
|
||||||||||||
Visit the :atlas:`Atlas documentation </atlas-vector-search/tutorials/>` | ||||||||||||
to find more tutorials on using the {+driver-short+} to perform Atlas | ||||||||||||
Vector Searches. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: I would include this is in the Additional Information section and use the format for that section. |
||||||||||||
|
||||||||||||
Additional Information | ||||||||||||
---------------------- | ||||||||||||
|
||||||||||||
To learn more about Atlas Vector Search, see :atlas:`Atlas Vector Search </atlas-vector-search/>` | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
in the Atlas documentation. | ||||||||||||
|
||||||||||||
API Documentation | ||||||||||||
~~~~~~~~~~~~~~~~~ | ||||||||||||
|
||||||||||||
To learn more about the ``aggregate()`` method, see the | ||||||||||||
`API documentation <{+api+}/classes/Collection.html#aggregate>`__. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
S: Be specific in your hypertext links |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: Too make the title a bit more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaning towards keeping the title the same for consistency: this page is the one after the Atlas Search page already merged in: 9e31836 which is just called Atlas Search, and in our other docs that have avs pages they are all just titled atlas vector search https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/fundamentals/builders/vector-search/, https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/atlas-vector-search/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Titles should be between 30-60 characters (maintenance wiki). I'm going to add a check to the PR Checklist next week to make sure we check for title length!
Also, this page aligns with the content on the "Run Vector Search Queries" page of the Atlas docs, so I think it makes sense to have a similar title. Let me know what you think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good, I'm good with following the title guidelines!