How Do I Add Data to an Evolutionary Neural Memory?
Adding data to an ENM is done by sending messages through the Pod-OS SDK. Because an ENM is an Actor, all interaction happens via the standard message-passing protocol.
The Pod-OS SDK
Pod-OS provides client SDKs that handle connection management, message serialization, and response parsing. The SDK communicates with your Gateway, which routes messages to the appropriate ENM Actor.
Connecting to Your Gateway
import "github.com/PointOfData/pod-os-go-client"
client, err := podos.NewClient(podos.Config{
GatewayAddress: "skills.pod-os.com:9000",
ClientName: "my-application",
})
The client connects to your Gateway. From there, all messages are routed to the correct Actor by the actor network.
Creating Event Objects
Event Objects are the primary data entities in an ENM. A node has:
- A type — categorizes the node (e.g.,
Person,Product,Sensor) - Tags — key-value pairs holding the node's data
- An identity — automatically assigned, globally unique
// Create a single Event Object
response, err := client.Send("my-enm", podos.Message{
Action: "node.create",
Payload: map[string]interface{}{
"type": "Person",
"properties": map[string]interface{}{
"name": "Alice",
"email": "alice@example.com",
},
},
})
// response.Payload["id"] contains the newly assigned identity
Creating Links (Relationships)
Links connect Event Objects. Remember, in ENM all edges are bidirectional — creating an edge from A to B automatically allows traversal from B back to A.
// Create an edge between two nodes
response, err := client.Send("my-enm", podos.Message{
Action: "edge.create",
Payload: map[string]interface{}{
"from": "node-id-alice",
"to": "node-id-acme",
"type": "works-at",
"properties": map[string]interface{}{
"since": "2024-01-15",
"title": "Senior Engineer",
},
},
})
Bulk Data Ingestion
For large datasets, you can send batch messages to create many nodes and edges in a single request:
response, err := client.Send("my-enm", podos.Message{
Action: "batch.create",
Payload: map[string]interface{}{
"nodes": []map[string]interface{}{
{"type": "Person", "properties": map[string]interface{}{"name": "Alice"}},
{"type": "Person", "properties": map[string]interface{}{"name": "Bob"}},
{"type": "Company", "properties": map[string]interface{}{"name": "Acme Corp"}},
},
"edges": []map[string]interface{}{
{"from": "0", "to": "2", "type": "works-at"},
{"from": "1", "to": "2", "type": "works-at"},
},
},
})
In batch operations, edges can reference nodes by their index in the nodes array (as shown with "0", "1", "2" above), allowing you to create interconnected data in a single message.
Updating Data
Nodes and edges can be updated by sending update messages:
// Update a node's properties
response, err := client.Send("my-enm", podos.Message{
Action: "node.update",
Payload: map[string]interface{}{
"id": "node-id-alice",
"properties": map[string]interface{}{
"role": "staff engineer", // updated field
"team": "platform", // new field (evolutionary — no migration needed)
},
},
})
Notice that adding a new property (team) requires no schema change or migration. This is the evolutionary nature of ENM — your data structure grows naturally.
Testing with Direct Messaging
During development, you can use the Direct Messaging tool in the Pod-OS dashboard to send messages to your ENM without writing code. This is useful for:
- Verifying your ENM is responding correctly
- Testing message formats before building SDK integration
- Debugging data issues by sending queries interactively
Navigate to Send Message in the dashboard sidebar, select your ENM Actor, and compose your message in the editor.
Next: How do I query data in my ENM? — learn how to retrieve and traverse your data graph.