curl --request POST \
--url http://localhost:8080/v1/store \
--header 'Content-Type: application/json' \
--header 'x-hyphae-key: <api-key>' \
--data '
{
"content": "<string>",
"salience": 0.5,
"scene_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"idempotency_key": "<string>"
}
'import requests
url = "http://localhost:8080/v1/store"
payload = {
"content": "<string>",
"salience": 0.5,
"scene_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"idempotency_key": "<string>"
}
headers = {
"x-hyphae-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-hyphae-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
salience: 0.5,
scene_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
idempotency_key: '<string>'
})
};
fetch('http://localhost:8080/v1/store', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/store",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'salience' => 0.5,
'scene_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-hyphae-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/v1/store"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-hyphae-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/v1/store")
.header("x-hyphae-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/store")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-hyphae-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Store a knowledge cell
Store a single cell of knowledge and return its node id. Validation, quota, and authorization run inside the facade. source_agent and tenant_id are stamped from the authenticated principal and cannot be set by the client.
curl --request POST \
--url http://localhost:8080/v1/store \
--header 'Content-Type: application/json' \
--header 'x-hyphae-key: <api-key>' \
--data '
{
"content": "<string>",
"salience": 0.5,
"scene_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"idempotency_key": "<string>"
}
'import requests
url = "http://localhost:8080/v1/store"
payload = {
"content": "<string>",
"salience": 0.5,
"scene_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"idempotency_key": "<string>"
}
headers = {
"x-hyphae-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-hyphae-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
salience: 0.5,
scene_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
idempotency_key: '<string>'
})
};
fetch('http://localhost:8080/v1/store', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/store",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'salience' => 0.5,
'scene_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-hyphae-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/v1/store"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-hyphae-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/v1/store")
.header("x-hyphae-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/store")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-hyphae-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"salience\": 0.5,\n \"scene_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"node_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Authorizations
The API key issued for the calling agent. Required on every endpoint except GET /healthz.
Body
The body for POST /v1/store.
The cell's text content.
The nine cell types the energy and promotion models are calibrated against.
Decision, Constraint, Risk, Pattern, Lesson, Fact, Preference, Context, Task Importance hint in [0.0, 1.0]; the server clamps out-of-range values.
0 <= x <= 1An optional owning scene id.
A reference back to the source of a cell's content (e.g. file:line, url).
Show child attributes
Show child attributes
Arbitrary JSON metadata; defaults to an empty object.
An optional key to deduplicate retried stores.
Response
The stored cell's node id.
The stored cell's node id.