Skip to content

Commit 88c5f87

Browse files
authored
DOCSP-43494-copilot-docs-command (#96)
1 parent 7c50b20 commit 88c5f87

File tree

6 files changed

+99
-14
lines changed

6 files changed

+99
-14
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cifs = ":abbr:`CIFS (Common Internet File System)`"
4141
cps = ":abbr:`CPS (Cloud Provider Snapshots)`"
4242
cmk = ":abbr:`CMK (customer master key)`"
4343
compass = "MongoDB Compass"
44-
copilot = "MongoDB GitHub Copilot Participant"
44+
copilot = "MongoDB Extension for Github Copilot"
4545
data-lakes = "Data Lakes"
4646
data-lake = "Data Lake"
4747
datadog = "`Datadog <https://www.datadoghq.com/>`__"

source/copilot-docs.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
.. _vsce-copilot-docs:
2+
3+
==============
4+
/docs Command
5+
==============
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
The ``/docs`` command provides MongoDB-specific information,
16+
supplemented by links to MongoDB Documentation. The |copilot| uses
17+
Retrival-Augmented Generation (RAG) to generate responses based on the
18+
latest version of MongoDB Documentation.
19+
20+
Examples
21+
--------
22+
23+
The rest of this page illustrates example use cases for the ``/docs``
24+
command:
25+
26+
Instructional Questions
27+
~~~~~~~~~~~~~~~~~~~~~~~
28+
29+
You can use the ``/docs`` command to ask how to perform specific
30+
operations. The following prompt asks for information on creating an
31+
index:
32+
33+
.. code-block:: none
34+
:copyable: false
35+
36+
@MongoDB /docs How do I create an index?
37+
38+
The |copilot| first provides the following MongoDB documentation:
39+
40+
- `Create an Index <https://www.mongodb.com/docs/manual/core/indexes/create-index/>`__
41+
- `createIndexes <https://mongodb.com/docs/manual/reference/command/createIndexes/>`__
42+
- `db.collection.createIndex() <https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/>`__
43+
- `Partial Indexes <https://www.mongodb.com/docs/manual/core/index-partial/>`_
44+
- `db.collection.createIndexes() <https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndexes/>`_
45+
46+
The generated response also contains information about creating an index
47+
and code examples:
48+
49+
.. figure:: /images/copilot-docs.png
50+
:figwidth: 700px
51+
:alt: Screenshot of copilot providing information on creating an index
52+
53+
Strategic Questions
54+
~~~~~~~~~~~~~~~~~~~
55+
56+
You can also use the ``/docs`` command to ask for operation
57+
recommendations. The following prompt asks the |copilot| for a
58+
recommendation on the best way to perform semantic search:
59+
60+
.. code-block:: none
61+
:copyable: false
62+
63+
@MongoDB /docs what is the best way to perform semantic search on my
64+
data?
65+
66+
The generated response recommends using Atlas Vector Search and provides
67+
the following links to MongoDB documentation:
68+
69+
- `Atlas Vector Search Overview <https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/>`_
70+
- `How to Do Semantic Search in MongoDB Using Atlas Vector Search <https://www.mongodb.com/developer/products/atlas/semantic-search-mongodb-atlas-vector-search/>`_
71+
- `How to Perform Semantic Search Against Data in Your Atlas Cluster <https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-tutorial/>`__
72+
73+
The response also includes steps to get started with Atlas Vector
74+
Search, with a code example:
75+
76+
.. figure:: /images/copilot-docs2.png
77+
:figwidth: 700px
78+
:alt: Screenshot of copilot providing information on using vector search

source/copilot-query.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Consider the ``users`` collection in the `Mflix Sample Database
3131
<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
3232
Each document in the collection has the following structure:
3333

34-
.. code-block:: javascript
34+
.. code-block:: none
3535
:copyable: false
3636

3737
{
@@ -48,7 +48,7 @@ collection, you can ask the GitHub Copilot chat to generate a query that
4848
finds the document in the ``users`` collection that has the ``name``
4949
value of ``Kayden Washington``.
5050

51-
.. code-block:: javascript
51+
.. code-block:: none
5252
:copyable: false
5353

5454
@MongoDB /query In the sample_mflix database, find a document in the
@@ -57,7 +57,7 @@ value of ``Kayden Washington``.
5757
The GitHub Copilot Chat uses the |copilot| to
5858
generate the following query using knowledge of your database schema:
5959

60-
.. code-block:: javascript
60+
.. code-block:: none
6161

6262
use(`sample_mflix`);
6363
db.getCollection('users').findOne({ name: 'Kayden Washington' });
@@ -77,7 +77,7 @@ the ``users`` collection in the `Mflix Sample Database
7777
<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
7878
Each document in the collection has the following structure:
7979

80-
.. code-block:: javascript
80+
.. code-block:: none
8181
:copyable: false
8282

8383
{
@@ -92,7 +92,7 @@ Each document in the collection has the following structure:
9292
Once you connect to the deployment that contains the ``users``
9393
collection, you can ask the GitHub Copilot chat to generate an aggregation pipeline.
9494

95-
.. code-block:: javascript
95+
.. code-block:: none
9696
:copyable: false
9797

9898
@MongoDB /query Generate an aggregation pipeline on the users
@@ -101,7 +101,7 @@ collection, you can ask the GitHub Copilot chat to generate an aggregation pipel
101101

102102
The |copilot| generates the following aggregation pipeline:
103103

104-
.. code-block:: javascript
104+
.. code-block:: none
105105

106106
use('sample_mflix');
107107
db.getCollection('users').aggregate([
@@ -118,7 +118,7 @@ directly or open the pipeline in a playground.
118118

119119
You can also iteratively build on your aggregation pipeline:
120120

121-
.. code-block:: javascript
121+
.. code-block:: none
122122
:copyable: false
123123

124124
@MongoDB /query Add a stage to my pipeline that adds a username field
@@ -127,7 +127,7 @@ You can also iteratively build on your aggregation pipeline:
127127

128128
The |copilot| returns the following aggregation pipeline:
129129

130-
.. code-block:: javascript
130+
.. code-block:: none
131131

132132
use('sample_mflix');
133133
db.getCollection('users').aggregate([

source/copilot.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
|vsce-full| includes the |copilot| to assist in using `GitHub Copilot
1616
<https://github.com/features/copilot>`__ with your MongoDB deployments.
17-
Through GitHub Copilot's chat feature, users with |vsce| can interact
18-
with their MongoDB clusters and generate code with MongoDB
19-
domain-specific knowledge on top of GitHub Copilot's LLM. The |copilot|
20-
can also answer questions about your database collection schema and
21-
provide links to specific MongoDB documentation.
17+
Through GitHub Copilot's chat feature, users with |vsce| can learn about
18+
MongoDB, interact with their MongoDB clusters, and generate code with
19+
MongoDB domain-specific knowledge on top of GitHub Copilot's LLM. The
20+
|copilot| can also answer questions about your database collection
21+
schema and provide links to specific MongoDB documentation.
2222

2323
The |copilot| includes MongoDB-specific
2424
commands to assist in interacting with your deployment.
@@ -32,10 +32,17 @@ Commands
3232
The ``/query`` command assists in generating queries from a natural
3333
language against a connected MongoDB cluster.
3434

35+
:ref:`/docs <vsce-copilot-docs>`
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+
The ``/docs`` command provides links to MongoDB documentation to
39+
supplement generated information.
40+
3541
.. toctree::
3642
:titlesonly:
3743

3844
/query </copilot-query>
45+
/docs </copilot-docs>
3946
AI & Data Usage </ai-data-usage>
4047

4148

source/images/copilot-docs.png

174 KB
Loading

source/images/copilot-docs2.png

223 KB
Loading

0 commit comments

Comments
 (0)