DatomVerse API Documentation

Version 4.0 - Evolution 4: Advanced Context Service

Quick Start

const ws = new WebSocket('wss://datomverse.com/ws');

ws.onopen = () => {
  // Assert a fact
  ws.send(JSON.stringify({
    type: 'assert',
    id: 'req_1',
    payload: {
      entity_id: 'user_123',
      attribute: 'name',
      value: 'Alice'
    }
  }));
};

ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
  console.log('Response:', response);
};

Operations

Assert Fact

Store an immutable fact about an entity.

{
  "type": "assert",
  "id": "unique_id",
  "payload": {
    "entity_id": "entity_123",
    "attribute": "attribute_name",
    "value": "any JSON value"
  }
}

Context Assembly (E4)

Get AI-generated narrative from facts with intent understanding.

{
  "type": "context",
  "id": "unique_id",
  "payload": {
    "prompt": "What decisions have been made?",
    "entity_id": "optional_filter",
    "max_tokens": 500,
    "stream": true
  }
}

Understood Prompts:

Semantic Search

Find facts by meaning using AI embeddings.

{
  "type": "semantic_search",
  "id": "unique_id",
  "payload": {
    "query": "vacation planning",
    "limit": 20
  }
}

Query Pattern

Query facts using pattern matching. Variables start with "?".

{
  "type": "query",
  "id": "unique_id",
  "payload": {
    "clauses": [
      ["?entity", "type", "user"],
      ["?entity", "status", "active"]
    ]
  }
}

Architecture

DatomVerse uses:

Key Concepts

Open Source

DatomVerse is open source and can run locally or on Cloudflare.

View on GitHub →