GAIuS RESTful API

This document outlines the REST API used to interact with GAIuS Agents via the GAIuS API Docker container. The GAIuS API docker container then interfaces with Cognitive Processors and Manipulatives via gRPC to execute the specified commands. These commands correlate similarly with commands in the AgentClient class.

View Entire Routing Table: HTTP Routing Table

Note

The examples in this documentation assume that a GAIuS Agent is started on your local machine, using HTTP at port 8000. These examples must be updated accordingly with your usecase

Four Core API Calls

POST /(str: primitive_id)/observe

Observes a GDF on a Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID to observe on

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/observe HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
Content-Type: application/json
X-API-KEY: ABCD-1234

{"data":{"strings":["hello"]}}

curl

curl -i -X POST http://localhost:8000/p46b6b076c/observe -H "Accept: application/json, text/javascript" -H "Content-Type: application/json" -H "X-Api-Key: ABCD-1234" --data-raw '{"data": {"strings": ["hello"]}}'

wget

wget -S -O- http://localhost:8000/p46b6b076c/observe --header="Accept: application/json, text/javascript" --header="Content-Type: application/json" --header="X-Api-Key: ABCD-1234" --post-data='{"data": {"strings": ["hello"]}}'

python-requests

requests.post('http://localhost:8000/p46b6b076c/observe', headers={'Accept': 'application/json, text/javascript', 'Content-Type': 'application/json', 'X-Api-Key': 'ABCD-1234'}, json={'data': {'strings': ['hello']}})
Request JSON Object:
  • strings (jsonobj jsonarr string) – GDF Strings field

  • vectors (jsonobj jsonarr jsonarr float) – GDF Vectors field

  • emotives (jsonobj) – GDF Emotives field

  • metadata (jsonobj) – GDF Metadata field

  • command (jsonobj string) – Depricated field

  • unique_id (jsonobj string) – Depricated field

Example response:

HTTP/1.1 200 OK
content-length: 230
content-type: application/json; charset=utf-8
Response JSON Object:
  • id (string) – Unique ID of Cognitive Processor

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (jsonobj) – Details about the result of the observe event

  • status (string) – Depicts the status of the observe event. Either “okay” or “failed”

Status Codes:
POST /(str: primitive_id)/learn

Learn sequence from the working memory on specified Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/learn HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/learn -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/learn --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/learn', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
Vary: Accept
content-length: 131
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":6,
"message":"MODEL|7d0678ba6305341ce0d25133ab086208656a562f",
"status":"okay",
"time_stamp":1677701062}
Status Codes:
POST /(str: primitive_id)/working-memory/clear

Clear working memory on specified Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/working-memory/clear HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/working-memory/clear -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/working-memory/clear --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/working-memory/clear', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 95
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"wm-cleared",
"status":"okay",
"time_stamp":1677706509}
Status Codes:
POST /(str: primitive_id)/predictions

Get list of prediction objects from specified Cognitive Processor based on current working memory

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/predictions HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
Status Codes:

http

POST /p46b6b076c/predictions HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/predictions -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/predictions --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/predictions', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Helper Functionality

GET /connect

Connect to GAIuS API and retrieve Genome of connected Cognitive Processors & Manipulatives

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

GET /p46b6b076c/connect HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
Response JSON Object:
  • connection (string) – Depicts the status of the observe event. Either “okay” or “failed”

  • genie (string) – Name of the agent, based on Genome

  • genome (jsonobj) – JSON object holding the entire Genome of the connected agent.

Status Codes:
GET /(str: primitive_id)/ping

Ping Cognitive Processor or GAIuS API

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID or “agent” to ping GAIuS API

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

GET /agent/ping HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
Vary: Accept
content-length: 17
Content-Type: text/javascript

{"status":"okay"}
Status Codes:

http

GET /agent/ping HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/agent/ping -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/agent/ping --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/agent/ping', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/clear-all-memory

Reset Cognitive Processor’s memory to an initial state. Genes/GCPs are not reset as a result of this command

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/clear-all-memory HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":0,
"message":"all-cleared",
"status":"okay",
"time_stamp":1677696465}
Response JSON Object:
  • id (string) – Cognitive Processor Unique ID

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (string) – Message depicting action taken

  • status (string) – Depicts the status of the clear all memory event. Either “okay” or “failed”

  • time_stamp (string) – time_stamp at which the clear all memory event occurred

Status Codes:

http

POST /p46b6b076c/clear-all-memory HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/clear-all-memory -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/clear-all-memory --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/clear-all-memory', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
GET /(str: primitive_id)/status

Show current status of the Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

GET /p46b6b076c/status HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":0,
"message":{"AUTOLEARN":false,"PREDICT":true,"SLEEPING":false,"emotives":{},"last_learned_model_name":"","models_kb":"{KB| objects: 0}","name":"P1","num_observe_call":0,"size_WM":0,"target":"","time":0,"vectors_kb":"{KB| objects: 0}"},
"status":"okay",
"time_stamp":1677696703}
Response JSON Object:
  • id (string) – Cognitive Processor Unique ID

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (string) – Message depicting status of Cognitive Processor, including values of internal parameters, etc.

  • status (string) – Depicts the status of the clear all memory event. Either “okay” or “failed”

  • time_stamp (string) – time_stamp at which the clear all memory event occurred

Status Codes:

http

GET /p46b6b076c/status HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/status -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/status --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/status', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/gene/increment-recall-threshold

Increment recall threshold by specified amount

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/gene/increment-recall-threshold HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
Content-Type: application/json
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 93
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"0.200000",
"status":"okay",
"time_stamp":1677703231}

http

POST /p46b6b076c/gene/increment-recall-threshold HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
Content-Type: application/json
X-API-KEY: ABCD-1234

{"increment": 0.10}

curl

curl -i -X POST http://localhost:8000/p46b6b076c/gene/increment-recall-threshold -H "Accept: application/json, text/javascript" -H "Content-Type: application/json" -H "X-Api-Key: ABCD-1234" --data-raw '{"increment": 0.1}'

wget

wget -S -O- http://localhost:8000/p46b6b076c/gene/increment-recall-threshold --header="Accept: application/json, text/javascript" --header="Content-Type: application/json" --header="X-Api-Key: ABCD-1234" --post-data='{"increment": 0.1}'

python-requests

requests.post('http://localhost:8000/p46b6b076c/gene/increment-recall-threshold', headers={'Accept': 'application/json, text/javascript', 'Content-Type': 'application/json', 'X-Api-Key': 'ABCD-1234'}, json={'increment': 0.1})
POST /(str: primitive_id)/predicting/stop

Disable predicting

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/predicting/stop HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 108
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"deactivated-predictions",
"status":"okay",
"time_stamp":1677703360}

http

POST /p46b6b076c/predicting/stop HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/predicting/stop -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/predicting/stop --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/predicting/stop', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/predicting/start

Enable predicting

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/predicting/start HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 106
content-type: application/json; charset=utf-8

{"id":"p46b6b076c","interval":0,"message":"activated-predictions","status":"okay","time_stamp":1677703468}

http

POST /p46b6b076c/predicting/start HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/predicting/start -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/predicting/start --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/predicting/start', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/autolearning/stop

Disable automatic learning

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/autolearning/stop HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 106
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"deactivated-autolearn",
"status":"okay",
"time_stamp":1677703571}

http

POST /p46b6b076c/autolearning/stop HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/autolearning/stop -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/autolearning/stop --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/autolearning/stop', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/autolearning/start

Enable automatic learning

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

POST /p46b6b076c/autolearning/start HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 106
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"activated-autolearn",
"status":"okay",
"time_stamp":1677703638}

http

POST /p46b6b076c/autolearning/start HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/autolearning/start -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/autolearning/start --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/autolearning/start', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
GET /(str: primitive_id)/gene/(str: gene)

Retrieve value of gene from Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

GET /p46b6b076c/gene/recall_threshold HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

Example response:

HTTP/1.1 200 OK
content-length: 93
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"0.200000",
"status":"okay",
"time_stamp":1677703721}

http

GET /p46b6b076c/gene/recall_threshold HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/gene/recall_threshold -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/gene/recall_threshold --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/gene/recall_threshold', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/genes/change

Update value of genes provided in request body

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/genes/change HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
content-type: application/json
X-API-KEY: ABCD-1234

{"data": {"recall_threshold": 0.10}}

curl

curl -i -X POST http://localhost:8000/p46b6b076c/genes/change -H "Accept: application/json, text/javascript" -H "Content-Type: application/json" -H "X-Api-Key: ABCD-1234" --data-raw '{"data": {"recall_threshold": 0.1}}'

wget

wget -S -O- http://localhost:8000/p46b6b076c/genes/change --header="Accept: application/json, text/javascript" --header="Content-Type: application/json" --header="X-Api-Key: ABCD-1234" --post-data='{"data": {"recall_threshold": 0.1}}'

python-requests

requests.post('http://localhost:8000/p46b6b076c/genes/change', headers={'Accept': 'application/json, text/javascript', 'Content-Type': 'application/json', 'X-Api-Key': 'ABCD-1234'}, json={'data': {'recall_threshold': 0.1}})

Example response:

HTTP/1.1 200 OK
content-length: 98
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"updated-genes",
"status":"okay",
"time_stamp":1677704450}
POST /(str: primitive_id)/sleeping/stop

Stop sleeping

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/sleeping/stop HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/sleeping/stop -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/sleeping/stop --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/sleeping/stop', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 90
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"awake",
"status":"okay",
"time_stamp":1677704626}
POST /(str: primitive_id)/sleeping/start

Start sleeping (ignore all observation data)

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/sleeping/start HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/sleeping/start -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/sleeping/start --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/sleeping/start', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 91
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"asleep",
"status":"okay",
"time_stamp":1677704710}
GET /(str: primitive_id)/percept-data
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/percept-data HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/percept-data -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/percept-data --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/percept-data', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 85
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":{},
"status":"okay",
"time_stamp":1677704911}
GET /(str: primitive_id)/cognition-data
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/cognition-data HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/cognition-data -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/cognition-data --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/cognition-data', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 226
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":{"command":"","emotives":{},"metadata":{},"path":[],"predictions":[],"strings":[],"symbols":[],"unique_id":"","vectors":[],"working_memory":[]},
"status":"okay",
"time_stamp":1677704951}
POST /(str: primitive_id)/set-target-class
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/set-target-class HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/set-target-class -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/set-target-class --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/set-target-class', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 101
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"set-target-class",
"status":"okay",
"time_stamp":1677705095}
POST /(str: primitive_id)/clear-target-class
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/clear-target-class HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/clear-target-class -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/clear-target-class --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/clear-target-class', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 105
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":"cleared-target-class",
"status":"okay",
"time_stamp":1677705194}
GET /(str: primitive_id)/get_kb
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/get_kb HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/get_kb -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/get_kb --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/get_kb', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/load_kb
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/load_kb HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

{"symbols_kb":{}, "vectors_kb": {}, "models_kb": {}, "metadata": {}}

curl

curl -i -X POST http://localhost:8000/p46b6b076c/load_kb -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234" --data-raw '{"symbols_kb":{}, "vectors_kb": {}, "models_kb": {}, "metadata": {}}'

wget

wget -S -O- http://localhost:8000/p46b6b076c/load_kb --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234" --post-data='{"symbols_kb":{}, "vectors_kb": {}, "models_kb": {}, "metadata": {}}'

python-requests

requests.post('http://localhost:8000/p46b6b076c/load_kb', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'}, data='{"symbols_kb":{}, "vectors_kb": {}, "models_kb": {}, "metadata": {}}')
GET /(str: primitive_id)/model/(str: model)
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key .. sourcecode:: http

Example request:

http

GET /p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
DELETE /(str: primitive_id)/model/(str: model)
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

DELETE /p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X DELETE 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- --method=DELETE 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.delete('http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
PUT /(str: primitive_id)/model/(str: model)
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

PUT /p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X PUT 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- --method=PUT 'http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f' --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.put('http://localhost:8000/p46b6b076c/model/MODEL|7d0678ba6305341ce0d25133ab086208656a562f', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
GET /(str: primitive_id)/working-memory
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/working-memory HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/working-memory -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/working-memory --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/working-memory', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
GET /(str: primitive_id)/vector
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/vector HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
Content-Type: application/json
X-API-KEY: ABCD-1234

{"data": "VECTOR|ABCD1234"}

curl

curl -i -X GET http://localhost:8000/p46b6b076c/vector -H "Accept: application/json, text/javascript" -H "Content-Type: application/json" -H "X-Api-Key: ABCD-1234" --data-raw '{"data": "VECTOR|ABCD1234"}'

wget

wget -S -O- http://localhost:8000/p46b6b076c/vector --header="Accept: application/json, text/javascript" --header="Content-Type: application/json" --header="X-Api-Key: ABCD-1234" --body-data='{"data": "VECTOR|ABCD1234"}'

python-requests

requests.get('http://localhost:8000/p46b6b076c/vector', headers={'Accept': 'application/json, text/javascript', 'Content-Type': 'application/json', 'X-Api-Key': 'ABCD-1234'}, json={'data': 'VECTOR|ABCD1234'})

Note

Upon failure, the time_stamp field of the response will be set to -1, and the message field of the response will contain a descriptive message depicting the error encountered

GET /(str: primitive_id)/all-genes
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/all-genes HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/all-genes -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/all-genes --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/all-genes', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
content-length: 564
content-type: application/json; charset=utf-8

{"id":"p46b6b076c",
"interval":0,
"message":{"genes":{"SORT":"sorting","always_update_frequencies":false,"auto_learn_algorithm":"basic","auto_learn_metric":"wm_size","classifier":"CVC","max_predictions":100,"max_sequence_length":0,"near_vector_count":3,"persistence":5,"predict_on_nth_event":1,"prediction_sort_metric":"potential","prediction_threshold":0,"prediction_threshold_direction":"greater than","prediction_threshold_metric":"potential","quiescence":3,"recall_threshold":0.1,"smoothness":3,"wm_resolution":"symbol"}},
"status":"okay",
"time_stamp":1677705501}
POST /(str: primitive_id)/get-models-with-symbols
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/get-models-with-symbols HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/get-models-with-symbols -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/get-models-with-symbols --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/get-models-with-symbols', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/get-models-with-patterns
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/get-models-with-patterns HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/get-models-with-patterns -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/get-models-with-patterns --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/get-models-with-patterns', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
PUT /(str: primitive_id)/add-model
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

PUT /p46b6b076c/add-model HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X PUT http://localhost:8000/p46b6b076c/add-model -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- --method=PUT http://localhost:8000/p46b6b076c/add-model --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.put('http://localhost:8000/p46b6b076c/add-model', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
DELETE /(str: primitive_id)/symbols/remove
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/symbols/remove HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/symbols/remove -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/symbols/remove --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/symbols/remove', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
DELETE /(str: primitive_id)/patterns/remove
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

DELETE /p46b6b076c/patterns/remove HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X DELETE http://localhost:8000/p46b6b076c/patterns/remove -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- --method=DELETE http://localhost:8000/p46b6b076c/patterns/remove --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.delete('http://localhost:8000/p46b6b076c/patterns/remove', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
POST /(str: primitive_id)/blacklisted-symbols/add
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

POST /p46b6b076c/blacklisted-symbols/add HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X POST http://localhost:8000/p46b6b076c/blacklisted-symbols/add -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/blacklisted-symbols/add --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.post('http://localhost:8000/p46b6b076c/blacklisted-symbols/add', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
GET /(str: primitive_id)/list-blacklisted-symbols
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/list-blacklisted-symbols HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/list-blacklisted-symbols -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/list-blacklisted-symbols --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/list-blacklisted-symbols', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})
DELETE /(str: primitive_id)/blacklisted-symbols/remove
Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

DELETE /p46b6b076c/blacklisted-symbols/remove HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X DELETE http://localhost:8000/p46b6b076c/blacklisted-symbols/remove -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- --method=DELETE http://localhost:8000/p46b6b076c/blacklisted-symbols/remove --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.delete('http://localhost:8000/p46b6b076c/blacklisted-symbols/remove', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Miscellaneous Endpoints

GET /(str: primitive_id)/name

Get the friendly name of the Cognitive Processor (e.g. P1, P2, …)

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/name HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/name -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/name --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/name', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
Vary: Accept
content-length: 87
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":0,
"message":"P1",
"status":"okay",
"time_stamp":1677697253}
Response JSON Object:
  • id (string) – Cognitive Processor Unique ID

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (string) – Friendly name of the Cognitive Processor

  • status (string) – Depicts the status of the clear all memory event. Either “okay” or “failed”

  • time_stamp (string) – time_stamp at which the clear all memory event occurred

Status Codes:
GET /(str: primitive_id)/info

Get debug information from the Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/info HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/info -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/info --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/info', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
Vary: Accept
content-length: 219
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":0,
"message":{"build_date":"12-07-2022","build_number":"1002","classifier":"CVC","id":"p46b6b076c","name":"P1","time":0,"version":"GAIuS Kehl (v12)"},
"status":"okay",
"time_stamp":1677697491}
Response JSON Object:
  • id (string) – Cognitive Processor Unique ID

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (jsonobj) – Debugging information

  • status (string) – Depicts the status of the clear all memory event. Either “okay” or “failed”

  • time_stamp (string) – time_stamp at which the clear all memory event occurred

Status Codes:
GET /(str: primitive_id)/time

Get time from the Cognitive Processor

Parameters:
  • primitive_id (string) – Cognitive Processor Unique ID

Request Headers:
  • X-API-KEY – Secret API Key

Example request:

http

GET /p46b6b076c/time HTTP/1.1
Host: localhost:8000
Accept: application/json, text/javascript
X-API-KEY: ABCD-1234

curl

curl -i -X GET http://localhost:8000/p46b6b076c/time -H "Accept: application/json, text/javascript" -H "X-Api-Key: ABCD-1234"

wget

wget -S -O- http://localhost:8000/p46b6b076c/time --header="Accept: application/json, text/javascript" --header="X-Api-Key: ABCD-1234"

python-requests

requests.get('http://localhost:8000/p46b6b076c/time', headers={'Accept': 'application/json, text/javascript', 'X-Api-Key': 'ABCD-1234'})

Example response:

HTTP/1.1 200 OK
Vary: Accept
content-length: 86
Content-Type: text/javascript

{"id":"p46b6b076c",
"interval":0,
"message":"0",
"status":"okay",
"time_stamp":1677697572}
Response JSON Object:
  • id (string) – Cognitive Processor Unique ID

  • interval (int) – Discrete time interval for events, tracked on Cognitive Processor

  • message (string) – Discrete timestep of the Cognitive Processor (as a string)

  • status (string) – Depicts the status of the clear all memory event. Either “okay” or “failed”

  • time_stamp (string) – time_stamp at which the clear all memory event occurred

Status Codes: