diff --git a/snooty.toml b/snooty.toml index da02b2a4..71b13c4b 100644 --- a/snooty.toml +++ b/snooty.toml @@ -41,7 +41,7 @@ cifs = ":abbr:`CIFS (Common Internet File System)`" cps = ":abbr:`CPS (Cloud Provider Snapshots)`" cmk = ":abbr:`CMK (customer master key)`" compass = "MongoDB Compass" -copilot = "MongoDB GitHub Copilot Participant" +copilot = "MongoDB Extension for Github Copilot" data-lakes = "Data Lakes" data-lake = "Data Lake" datadog = "`Datadog `__" diff --git a/source/copilot-docs.txt b/source/copilot-docs.txt new file mode 100644 index 00000000..63c31acf --- /dev/null +++ b/source/copilot-docs.txt @@ -0,0 +1,78 @@ +.. _vsce-copilot-docs: + +============== +/docs Command +============== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +The ``/docs`` command provides MongoDB-specific information, +supplemented by links to MongoDB Documentation. The |copilot| uses +Retrival-Augmented Generation (RAG) to generate responses based on the +latest version of MongoDB Documentation. + +Examples +-------- + +The rest of this page illustrates example use cases for the ``/docs`` +command: + +Instructional Questions +~~~~~~~~~~~~~~~~~~~~~~~ + +You can use the ``/docs`` command to ask how to perform specific +operations. The following prompt asks for information on creating an +index: + +.. code-block:: none + :copyable: false + + @MongoDB /docs How do I create an index? + +The |copilot| first provides the following MongoDB documentation: + +- `Create an Index `__ +- `createIndexes `__ +- `db.collection.createIndex() `__ +- `Partial Indexes `_ +- `db.collection.createIndexes() `_ + +The generated response also contains information about creating an index +and code examples: + +.. figure:: /images/copilot-docs.png + :figwidth: 700px + :alt: Screenshot of copilot providing information on creating an index + +Strategic Questions +~~~~~~~~~~~~~~~~~~~ + +You can also use the ``/docs`` command to ask for operation +recommendations. The following prompt asks the |copilot| for a +recommendation on the best way to perform semantic search: + +.. code-block:: none + :copyable: false + + @MongoDB /docs what is the best way to perform semantic search on my + data? + +The generated response recommends using Atlas Vector Search and provides +the following links to MongoDB documentation: + +- `Atlas Vector Search Overview `_ +- `How to Do Semantic Search in MongoDB Using Atlas Vector Search `_ +- `How to Perform Semantic Search Against Data in Your Atlas Cluster `__ + +The response also includes steps to get started with Atlas Vector +Search, with a code example: + +.. figure:: /images/copilot-docs2.png + :figwidth: 700px + :alt: Screenshot of copilot providing information on using vector search \ No newline at end of file diff --git a/source/copilot-query.txt b/source/copilot-query.txt index bc942045..5e692323 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -31,7 +31,7 @@ Consider the ``users`` collection in the `Mflix Sample Database `__. Each document in the collection has the following structure: -.. code-block:: javascript +.. code-block:: none :copyable: false { @@ -48,7 +48,7 @@ collection, you can ask the GitHub Copilot chat to generate a query that finds the document in the ``users`` collection that has the ``name`` value of ``Kayden Washington``. -.. code-block:: javascript +.. code-block:: none :copyable: false @MongoDB /query In the sample_mflix database, find a document in the @@ -57,7 +57,7 @@ value of ``Kayden Washington``. The GitHub Copilot Chat uses the |copilot| to generate the following query using knowledge of your database schema: -.. code-block:: javascript +.. code-block:: none use(`sample_mflix`); db.getCollection('users').findOne({ name: 'Kayden Washington' }); @@ -77,7 +77,7 @@ the ``users`` collection in the `Mflix Sample Database `__. Each document in the collection has the following structure: -.. code-block:: javascript +.. code-block:: none :copyable: false { @@ -92,7 +92,7 @@ Each document in the collection has the following structure: Once you connect to the deployment that contains the ``users`` collection, you can ask the GitHub Copilot chat to generate an aggregation pipeline. -.. code-block:: javascript +.. code-block:: none :copyable: false @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 The |copilot| generates the following aggregation pipeline: -.. code-block:: javascript +.. code-block:: none use('sample_mflix'); db.getCollection('users').aggregate([ @@ -118,7 +118,7 @@ directly or open the pipeline in a playground. You can also iteratively build on your aggregation pipeline: -.. code-block:: javascript +.. code-block:: none :copyable: false @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: The |copilot| returns the following aggregation pipeline: -.. code-block:: javascript +.. code-block:: none use('sample_mflix'); db.getCollection('users').aggregate([ diff --git a/source/copilot.txt b/source/copilot.txt index 4e1e9d23..17774e68 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -14,11 +14,11 @@ |vsce-full| includes the |copilot| to assist in using `GitHub Copilot `__ with your MongoDB deployments. -Through GitHub Copilot's chat feature, users with |vsce| can interact -with their MongoDB clusters and generate code with MongoDB -domain-specific knowledge on top of GitHub Copilot's LLM. The |copilot| -can also answer questions about your database collection schema and -provide links to specific MongoDB documentation. +Through GitHub Copilot's chat feature, users with |vsce| can learn about +MongoDB, interact with their MongoDB clusters, and generate code with +MongoDB domain-specific knowledge on top of GitHub Copilot's LLM. The +|copilot| can also answer questions about your database collection +schema and provide links to specific MongoDB documentation. The |copilot| includes MongoDB-specific commands to assist in interacting with your deployment. @@ -32,10 +32,17 @@ Commands The ``/query`` command assists in generating queries from a natural language against a connected MongoDB cluster. +:ref:`/docs ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``/docs`` command provides links to MongoDB documentation to +supplement generated information. + .. toctree:: :titlesonly: /query + /docs AI & Data Usage diff --git a/source/images/copilot-docs.png b/source/images/copilot-docs.png new file mode 100644 index 00000000..28724cf2 Binary files /dev/null and b/source/images/copilot-docs.png differ diff --git a/source/images/copilot-docs2.png b/source/images/copilot-docs2.png new file mode 100644 index 00000000..20cb7d3d Binary files /dev/null and b/source/images/copilot-docs2.png differ