textrawl
byJeff Green

get_entity_context

Retrieve all information about an entity

Get comprehensive context about an entity including all observations and relations.

Parameters

ParameterTypeRequiredDefaultDescription
entityNamestringREQUIRED-Name of entity to look up (1-200 chars)
includeRelatedbooleanOPTIONALtrueInclude relations in response

Example Request

{
  "entityName": "Jeff",
  "includeRelated": true
}

Response

Compact Mode (Default)

When COMPACT_RESPONSES=true (default), responses use short keys to reduce token usage by 40-60%:

{"ok":true,"n":"Jeff","t":"person","o":["prefers dark mode in IDEs","uses TypeScript for most projects"],"r":{"out":[{"rel":"works_at","to":"Acme Corp"},{"rel":"prefers","to":"TypeScript"}],"in":[{"rel":"manages","from":"Sarah"}]}}

Key mapping: ok=found, n=name, t=type, o=observations, r=relations, rel=relation_type

Verbose Mode

When COMPACT_RESPONSES=false:

{
  "found": true,
  "entity": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Jeff",
    "type": "person",
    "description": null
  },
  "observations": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "content": "prefers dark mode in IDEs",
      "source": "conversation",
      "confidence": 1.0,
      "created_at": "2026-01-05T10:00:00Z"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "content": "uses TypeScript for most projects",
      "source": "conversation",
      "confidence": 1.0,
      "created_at": "2026-01-04T15:30:00Z"
    }
  ],
  "relations": {
    "outgoing": [
      {
        "relation_type": "works_at",
        "to_entity": "Acme Corp",
        "to_entity_type": "organization",
        "strength": 1.0
      },
      {
        "relation_type": "prefers",
        "to_entity": "TypeScript",
        "to_entity_type": "concept",
        "strength": 1.0
      }
    ],
    "incoming": [
      {
        "relation_type": "manages",
        "from_entity": "Sarah",
        "from_entity_type": "person",
        "strength": 1.0
      }
    ]
  }
}

Entity Not Found

Compact Mode

{"ok":false}

Verbose Mode

{
  "found": false,
  "message": "No entity found with name: Unknown Person"
}

Use Cases

Before Responding to User

{
  "entityName": "User"
}

Get all known preferences and context before crafting a response.

Project Overview

{
  "entityName": "Project Alpha"
}

Retrieve all facts, technologies, and team relations for a project.

Quick Lookup (No Relations)

{
  "entityName": "TypeScript",
  "includeRelated": false
}

Get just the facts about an entity without relation queries.

Response Structure

FieldCompact KeyDescription
entityn, tBasic entity info (name, type)
observationsoAll stored facts about the entity
relations.outgoingr.outRelations where this entity is the source
relations.incomingr.inRelations where this entity is the target

Errors

ErrorCauseFix
Entity not foundNo entity exists with the provided nameVerify entity name or create entity first
Invalid entity nameName exceeds 200 chars or is emptyProvide a valid name (1-200 chars)
Memory not enabledENABLE_MEMORY feature flag is falseSet ENABLE_MEMORY=true
Database errorConnection or query failureCheck DB connectivity and logs

On this page