Skip to content

Commit 985208c

Browse files
Update nerdgraph-rag.mdx
1 parent a69bcb9 commit 985208c

File tree

1 file changed

+43
-41
lines changed

1 file changed

+43
-41
lines changed

src/content/docs/apis/nerdgraph/examples/nerdgraph-rag.mdx

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To learn more about the knowledge connector, refer to [New Relic AI Knowledge co
2424

2525
To start indexing your content and benefit from the knowledge connector with New Relic AI, follow these mentioned steps:
2626

27-
## Create your RAG tool [#create-your-rag-tool]
27+
## Task 1: Create your RAG tool [#create-your-rag-tool]
2828

2929
<CollapserGroup>
3030
<Collapser id ="get-started" title ="Obtain your organization ID">
@@ -33,7 +33,7 @@ Organization ID uniquely identifies your account and ensures that any RAG tool y
3333

3434
Organization ID is required to perform mutations and queries in NerdGraph when setting up and managing RAG tools and documents. Run the following query and keep the organization ID handy for later steps.
3535

36-
#### Sample query
36+
### Sample query
3737
```graphql
3838
{
3939
actor {
@@ -52,7 +52,8 @@ To create a new RAG tool in your New Relic account, run the following `entityMan
5252

5353
1. Make sure to replace `${ORGANIZATION_ID}` with your actual organization ID obtained in the previous step.
5454
2. If successful, you'll receive an `id` for your RAG tool.
55-
#### Input parameters
55+
56+
### Input parameters
5657

5758
<table>
5859
<thead>
@@ -103,7 +104,7 @@ To create a new RAG tool in your New Relic account, run the following `entityMan
103104
</tbody>
104105
</table>
105106

106-
#### Sample mutation
107+
### Sample mutation
107108
```graphql
108109
mutation {
109110
entityManagementCreateRagTool(
@@ -122,9 +123,11 @@ mutation {
122123

123124
You should save the `id` returned as you'll need it in later steps to link documents to the tool, verify relationships, and query the tool for relevant information in New Relic.
124125
</Collapser>
126+
</CollapserGroup>
125127

126-
## The indexing phase [#the-indexing-phase]
128+
## Task 2: Index your documents [#index-your-documents]
127129

130+
<CollapserGroup>
128131
<Collapser id = "upload-document" title = "Upload a document via the Blob API">
129132

130133
<Callout variant="important">
@@ -144,7 +147,7 @@ You need a valid New Relic API key with permissions to upload documents. To get
144147

145148
Here's an example of how to upload a document using a `curl` `bash` command:
146149

147-
#### Input parameters
150+
### Input parameters
148151

149152
<table>
150153
<thead>
@@ -184,7 +187,7 @@ Here's an example of how to upload a document using a `curl` `bash` command:
184187
</table>
185188

186189

187-
#### Sample query
190+
### Sample query
188191
```shell
189192
curl -X POST https://blob-api.one-service.newrelic.com/v1/e/organizations/$ORGANIZATION_ID/RagDocuments \
190193
-H 'Api-Key: NRAK-XXXXXXXXXX' \
@@ -193,7 +196,7 @@ curl -X POST https://blob-api.one-service.newrelic.com/v1/e/organizations/$ORGAN
193196
-d @incidents.json
194197
```
195198

196-
#### Sample response
199+
### Sample response
197200

198201
<table>
199202
<thead>
@@ -253,7 +256,7 @@ After a document is uploaded via the Blob API, running this query confirms that
253256
</tbody>
254257
</table>
255258

256-
#### Sample query
259+
### Sample query
257260

258261
In the query below, replace the `${RAG_DOCUMENT_GUID}` placeholder with the `entityGuid` you received in the previous step.
259262

@@ -293,7 +296,7 @@ Now that you've created a RAG tool, uploaded your document, and verified that th
293296
1. Replace `${RAG_DOCUMENT_GUID}` with the `entityGuid` from the response of the document upload via the Blob API.
294297
2. Replace `${RAG_TOOL_GUID}` with the `id` from the response of the RAG tool creation mutation.
295298

296-
#### Input parameters
299+
### Input parameters
297300

298301
<table>
299302
<thead>
@@ -356,7 +359,7 @@ Now that you've created a RAG tool, uploaded your document, and verified that th
356359
</tbody>
357360
</table>
358361

359-
#### Sample mutation
362+
### Sample mutation
360363

361364
```graphql
362365
mutation {
@@ -388,17 +391,19 @@ mutation {
388391
}
389392
```
390393
</Collapser>
394+
</CollapserGroup>
391395

392-
## The retrieval phase [#the-retrieval-phase]
396+
## Task 3: Retrieve relevant information [#retrieve-relevant-information]
393397

398+
<CollapserGroup>
394399
<Collapser id="query-to-see-relationships-between-rag-documents-and-rag-tools" title="Query to see relationships between RAG documents and RAG tools">
395400

396401
After creating a relationship between your RAG document and RAG tool, you can verify the association by querying relationships in NerdGraph. This helps ensure your document is properly linked and available for New Relic AI to use.
397402

398403
- Replace `${RAG_DOCUMENT_ID}` with the `entityGuid` of your uploaded document.
399404

400405

401-
#### Input parameters
406+
### Input parameters
402407

403408
<table>
404409
<thead>
@@ -437,7 +442,7 @@ After creating a relationship between your RAG document and RAG tool, you can ve
437442
</tbody>
438443
</table>
439444

440-
#### Sample query
445+
### Sample query
441446

442447
```graphql
443448
{
@@ -464,37 +469,34 @@ After creating a relationship between your RAG document and RAG tool, you can ve
464469

465470
After you've set up your RAG tool and indexed documents, you can query the RAG tool to retrieve relevant information based on your prompt. This allows New Relic AI to surface context-aware answers using your organization's documentation.
466471

467-
#### Input parameters
472+
### Input parameters
468473

469474
<table>
470-
<thead>
471-
<tr>
472-
<th>Parameter Name</th>
473-
<th>Data Type</th>
474-
<th>Is it Required?</th>
475-
<th>Description</th>
476-
<th>Response (If required)</th>
477-
</tr>
478-
</thead>
479-
<tbody>
480-
<tr>
481-
<td>`prompt`</td>
482-
<td>String</td>
483-
<td>Yes</td>
484-
<td>The natural language query you want the RAG tool to process.</td>
485-
<td>(Input parameter)</td>
486-
</tr>
487-
<tr>
488-
<td>`toolId`</td>
489-
<td>String</td>
490-
<td>Yes</td>
491-
<td>The unique GUID of the RAG tool to be queried.</td>
492-
<td>(Input parameter)</td>
493-
</tr>
494-
</tbody>
475+
<thead>
476+
<tr>
477+
<th>Parameter Name</th>
478+
<th>Data Type</th>
479+
<th>Is it Required?</th>
480+
<th>Description</th>
481+
</tr>
482+
</thead>
483+
<tbody>
484+
<tr>
485+
<td>`prompt`</td>
486+
<td>String</td>
487+
<td>Yes</td>
488+
<td>The natural language query you want the RAG tool to process.</td>
489+
</tr>
490+
<tr>
491+
<td>`toolId`</td>
492+
<td>String</td>
493+
<td>Yes</td>
494+
<td>The unique GUID of the RAG tool to be queried.</td>
495+
</tr>
496+
</tbody>
495497
</table>
496498

497-
#### Sample query
499+
### Sample query
498500
```graphql
499501
{
500502
actor {

0 commit comments

Comments
 (0)