Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
69 changes: 69 additions & 0 deletions source/copilot-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. _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| is

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the second sentence to something like:

For the docs command, the underlying model of the MongoDB Copilot Extension leverages Retrieval-Augmented Generation (RAG) to ensure responses are based on the latest version of MongoDB Documentation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

knowledgeable of the latest MongoDB Documentation and uses the
MongoDB Docs Chatbot to link to information in addition to
the text response.

Example

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a second example here where the docs command recommends a DDP product like vector search or search in the context of "how do I improve the searching speed for query" and it responds with search/vector search recommendation? For vector search we might have to ask something like 'semantic search' in the prompt. This way users know that it can also be leveraged for performance-related questions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a second example that recommends Atlas Vector Search!

-------

The following prompt asks for information on creating an
index in the GitHub Copilot chat:

.. code-block:: none
:copyable: false

@MongoDB /docs how do I create an index?

The chat first provides the following MongoDB documentation:

- `Create an Index <https://www.mongodb.com/docs/manual/core/indexes/create-index/>`__
- `createIndexes <https://mongodb.com/docs/manual/reference/command/createIndexes/>`__
- `Getting Started with MongoDB and Java - CRUD Operations Tutorial <https://www.mongodb.com/developer/languages/java/java-setup-crud-operations>`__
- `db.collection.createIndex() <https://mongodb.com/docs/manual/reference/method/db.collection.createIndex/>`__

The |copilot| also returns a text response with information about
creating an index:

.. code-block:: none
:copyable: false

To create an index in MongoDB, you can use the createIndex() method
in the MongoDB Shell or the equivalent method for your specific
driver. Here are examples for different programming languages:

MongoDB Shell

db.collection.createIndex({ <key and index type specification> }, { <options> })

C#

collection.CreateIndex(IndexKeys<collection>.<key and index type
specification>, <options>);

...

Indexes support efficient execution of queries in MongoDB. If your
application is repeatedly running queries on the same fields,
creating an index on those fields can significantly improve
performance. However, keep in mind that while indexes improve query

Check failure on line 63 in source/copilot-docs.txt

View workflow job for this annotation

GitHub Actions / TDBX Vale rules

[vale] reported by reviewdog 🐶 [MongoDB.ConciseTerms] 'remember' is preferred over 'keep in mind'. Raw Output: {"message": "[MongoDB.ConciseTerms] 'remember' is preferred over 'keep in mind'.", "location": {"path": "source/copilot-docs.txt", "range": {"start": {"line": 63, "column": 26}}}, "severity": "ERROR"}
performance, they can negatively impact write operations due to the
additional overhead of maintaining the index.

Check failure on line 65 in source/copilot-docs.txt

View workflow job for this annotation

GitHub Actions / TDBX Vale rules

[vale] reported by reviewdog 🐶 [MongoDB.ConciseTerms] 'more' is preferred over 'additional'. Raw Output: {"message": "[MongoDB.ConciseTerms] 'more' is preferred over 'additional'.", "location": {"path": "source/copilot-docs.txt", "range": {"start": {"line": 65, "column": 4}}}, "severity": "ERROR"}

.. figure:: /images/copilot-docs.png
:figwidth: 700px
:alt: Screenshot of copilot providing information on creating an index
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need the screenshot here, if it's just showing what we've described above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check in with Garaub about this one - he originally asked for screenshots on the /query page to illustrate the UI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - happy to leave in if it's a PM request :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GaurabAryal do you have preference here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i think since this is such a new product, it is better to have the visuals in the docs. Let's keep it for now.

16 changes: 8 additions & 8 deletions source/copilot-query.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Consider the ``users`` collection in the `Mflix Sample Database
<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
Each document in the collection has the following structure:

.. code-block:: javascript
.. code-block:: none
:copyable: false

{
Expand All @@ -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
Expand All @@ -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' });
Expand All @@ -77,7 +77,7 @@ the ``users`` collection in the `Mflix Sample Database
<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
Each document in the collection has the following structure:

.. code-block:: javascript
.. code-block:: none
:copyable: false

{
Expand All @@ -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
Expand All @@ -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([
Expand All @@ -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
Expand All @@ -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([
Expand Down
17 changes: 12 additions & 5 deletions source/copilot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

|vsce-full| includes the |copilot| to assist in using `GitHub Copilot
<https://github.com/features/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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One general comment @ltran-mdb2 – could we switch the wording from MongoDB Github Copilot Participant to MongoDB Extension for Github Copilot? I just confirmed with the team at VS Code that participant isn't the proper branding (more of an implementation detail) and they want us to go with "MongoDB Extension" instead. Sorry for the change in wording!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

schema and provide links to specific MongoDB documentation.

The |copilot| includes MongoDB-specific
commands to assist in interacting with your deployment.
Expand All @@ -32,10 +32,17 @@ Commands
The ``/query`` command assists in generating queries from a natural
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit above this, in the paragraph before, we have written:

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.

Should we add something about the MongoDB documentation chatbot there as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of simplicity, I would recommend only mentioning the documentation chatbot on the /docs page

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did add a mention of learning about MongoDB in this section (referring to the /docs command)

language against a connected MongoDB cluster.

:ref:`/docs <vsce-copilot-docs>`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``/docs`` command provides links to MongoDB documentation to
supplement generated information.

.. toctree::
:titlesonly:

/query </copilot-query>
/docs </copilot-docs>
AI & Data Usage </ai-data-usage>


Binary file added source/images/copilot-docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading