Quick Start: Hello, World!
[1]:
# update your agent information, and then connect to it
from ia.gaius.agent_client import AgentClient
api_key = '<YOUR-API-KEY-HERE>'
name = '<YOUR-AGENT-NAME-HERE>'
domain = 'localhost'
secure = True
agent_info = {'api_key': api_key,
'name': name,
'domain': domain,
'secure': secure}
[2]:
agent_info = {'api_key': 'ABCD-1234',
'name': '',
'domain': 'gaius-api:80',
'secure': False}
[3]:
agent = AgentClient(agent_info, verify=False)
agent.connect()
[3]:
{'connection': 'okay', 'agent': 'simple'}
[4]:
# Let's use only one node
ingress_nodes = ['P1']
query_nodes = ['P1']
agent.set_ingress_nodes(ingress_nodes)
agent.set_query_nodes(query_nodes)
[4]:
[{'id': 'p46b6b076c', 'name': 'P1'}]
Four API Calls
[5]:
# clear working memory
agent.clear_wm(nodes=ingress_nodes)
# agent.clear_wm()
[5]:
'wm-cleared'
[6]:
sequence_1 = [{"strings": ["hello"], "vectors": [], "emotives": {}},
{"strings": ["world"], "vectors": [], "emotives": {}}]
# Observe a sequence of events
for event in sequence_1:
agent.observe(data=event,nodes=ingress_nodes)
[7]:
# Learn a sequence
agent.learn(nodes=ingress_nodes)
[7]:
'MODEL|7d0678ba6305341ce0d25133ab086208656a562f'
[8]:
# Observe new data
agent.observe(data={"strings": ["hello"], "vectors": [], "emotives": {}},nodes=ingress_nodes)
[8]:
'observed'
[9]:
# Get Predictions
agent.get_predictions()
[9]:
[{'confidence': 1,
'confluence': 0.5,
'emotives': {},
'entropy': 0.5,
'evidence': 0.5,
'extras': [],
'fragmentation': 0,
'frequency': 5,
'future': [['world']],
'grand_hamiltonian': 0.5,
'hamiltonian': 0,
'itfdf_similarity': 1,
'matches': ['hello'],
'missing': [],
'name': '7d0678ba6305341ce0d25133ab086208656a562f',
'past': [],
'potential': 3.5,
'present': [['hello']],
'similarity': 0.666666687,
'snr': 1,
'type': 'prototypical'}]