Context Management APIs

Real Time Assist (RTA) provides context-sensitive support and guidance to agents during their interactions. The APIs allow users to provide context such as internal policies and procedures, prior customer interactions, etc. so that the RTA API can retrieve contextually relevant and accurate information using Retrieval Augmented Generation (RAG).

The context management can be done through a set APIs which allows you to ingest, and store contextual data from cloud storage buckets, making it available for retrieval in real-time assist (RTA) scenarios.

Benefits:

Adding context to RTA helps enterprises ground the RTA responses to their business context. This helps improve the quality and accuracy of model responses, while adhering to organizational policies.

How to add context for RTA

The following section provides a guide on how to add, delete and update context to real-time assistance using the standard CRUD operations:

Create Context

Use the following endpoint to ingest documents from a cloud storage bucket and associate them with a specific RTA ID:

POST https://api.symbl.ai/v1/manage/context

{
    "name": "My new GCP Context 52",
    "description": "A context for processing documents from GCP",
    "bucketURL": 
        "https://storage.googleapis.com/context_test1/testBucket.zip?x-goog-signature=4d83c25a9872449fbaee82f5c9173820ecb10c1f051e7b6260f0b9eda01f4f16724139f76c9eac1b47a2753e9397ef1df72f6f39c9bac25645c11f4661c9cee4c65aba7426a8afdd35410dd39e105ffe25ecd4444218bc06dc62f91edff91b49eba86e77466c119583a15e3372e58907f3263a832ec0e2b6a30bd28fdf71f8d09fd87c8e980a39b3483f418093754a6ec4db41a0768af2067da5c07b461e62acb9af8fd2a8b7783dade3235a19d20de84794b62752da1fec1f75e5c596d514501e528296eaacbcc299f1ed4c3d664b9f047d49ded2ed1ba38b7ca78e8b3c9165eaee80ff6d3a8fae818ac0b1faf83b75e48b75124ad2475c0d0d7f5f68827b8b&x-goog-algorithm=GOOG4-RSA-SHA256&x-goog-credential=context-text%40demoproject-406702.iam.gserviceaccount.com%2F20240925%2Fus%2Fstorage%2Fgoog4_request&x-goog-date=20240925T153442Z&x-goog-expires=86400&x-goog-signedheaders=host"

    ,
    "tags": ["gcp", "documents"]
}

Sample Response

{
 "jobId": "5dad1a8f-1be5-4798-8076-a740988b4778",
 "status": "submitted"
}

Note:In order to create a context, users need to provide a pre-signed URL of their zip file consisting of the documents which are stored in cloud providers such as AWS, Azure and GCP. Currently only .txt and .docx files are accepted formats for the documents.

Check Job Status

Use the following endpoint to check the status of an ingestion job for a specific RTA

GET https://api.symbl.ai/v1/manage/context/status/{jobId}

Sample Response

{
  "jobId": "5dad1a8f-1be5-4798-8076-a740988b4778",
  "name": "test context",
  "contextId": "Context-123", //in case of completed
  "status": "in_progress|completed|failed",
  "error":"some error"//in case of failed
}

Update Context

Make the following API request to the endpoint below to update the context. This ensures that the indexed files are replaced with the new set of files given in the bucket:

PUT https://api.symbl.ai/v1/manage/context/{contextId}

{
    "name": "My new GCP Context 52",
    "description": "A context for processing documents from GCP",
    "bucketURL": "https://storage.googleapis.com/context_test1/testBucket.zip?x-goog-signature=4d83c25a9872449fbaee82f5c9173820ecb10c1f051e7b6260f0b9eda01f4f16724139f76c9eac1b47a2753e9397ef1df72f6f39c9bac25645c11f4661c9cee4c65aba7426a8afdd35410dd39e105ffe25ecd4444218bc06dc62f91edff91b49eba86e77466c119583a15e3372e58907f3263a832ec0e2b6a30bd28fdf71f8d09fd87c8e980a39b3483f418093754a6ec4db41a0768af2067da5c07b461e62acb9af8fd2a8b7783dade3235a19d20de84794b62752da1fec1f75e5c596d514501e528296eaacbcc299f1ed4c3d664b9f047d49ded2ed1ba38b7ca78e8b3c9165eaee80ff6d3a8fae818ac0b1faf83b75e48b75124ad2475c0d0d7f5f68827b8b&x-goog-algorithm=GOOG4-RSA-SHA256&x-goog-credential=context-text%40demoproject-406702.iam.gserviceaccount.com%2F20240925%2Fus%2Fstorage%2Fgoog4_request&x-goog-date=20240925T153442Z&x-goog-expires=86400&x-goog-signedheaders=host",
    "tags": ["gcp", "documents"]
}

Sample Response

{
  "jobId": "5dad1a8f-1be5-4798-8076-a740988b4778",
  "status": "submitted"
}

Retrieve Contexts:

Use the following endpoint to retrieve the list of all contexts associated with your account:

GET https://api.symbl.ai/v1/manage/context

Sample Response

{
  "context": [
    "id": "Context-123",
    "bucketURL": "",
    "name": "Sales Policies 2023",
    "description": "Collection of sales policies and guidelines for 2023",
    "tags": ["policies", "guidelines"]
    "createdOn": "2023-09-01T12:00:00Z",
    "updatedOn": "2023-09-15T14:30:00Z",
    // ... more contexts
  ]
}

Retrieve Context by ID:

To get more information on a specific context, make an API request to the following endpoint:

GET https://api.symbl.ai/v1/manage/context/{contextId}

Sample Response

{

 "id": "Context-123",
 "name": "Sales Policies 2023",
 "description": "Collection of sales policies and guidelines for 2023",
 "createdOn": "2023-09-01T12:00:00Z",
 "updatedOn": "2023-09-15T14:30:00Z",
 "tags": ["policies", "guidelines"],
 "bucketURL": "https://storage.googleapis.com/context_test1/testBucket.zip?x-goog-signature=4d83c25a9872449fbaee82f5c9173820ecb10c1f051e7b6260f0b9eda01f4f16724139f76c9eac1b47a2753e9397ef1df72f6f39c9bac25645c11f4661c9cee4c65aba7426a8afdd35410dd39e105ffe25ecd4444218bc06dc62f91edff91b49eba86e77466c119583a15e3372e58907f3263a832ec0e2b6a30bd28fdf71f8d09fd87c8e980a39b3483f418093754a6ec4db41a0768af2067da5c07b461e62acb9af8fd2a8b7783dade3235a19d20de84794b62752da1fec1f75e5c596d514501e528296eaacbcc299f1ed4c3d664b9f047d49ded2ed1ba38b7ca78e8b3c9165eaee80ff6d3a8fae818ac0b1faf83b75e48b75124ad2475c0d0d7f5f68827b8b&x-goog-algorithm=GOOG4-RSA-SHA256&x-goog-credential=context-text%40demoproject-406702.iam.gserviceaccount.com%2F20240925%2Fus%2Fstorage%2Fgoog4_request&x-goog-date=20240925T153442Z&x-goog-expires=86400&x-goog-signedheaders=host"
 }

Delete Context

Make the following request to the endpoint below to delete contexts and the collections:

DELETE https://api.symbl.ai/v1/manage/context/{contextId}

Sample Response

//No response body

Response code (success) is 204