---
title: "Get Contextual Facts"
method: GET
path: "/api/knowledge-graph/facts/contextual"
tags: ["knowledge-graph", "knowledge-graph"]
---

# Get Contextual Facts

`GET /api/knowledge-graph/facts/contextual`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/knowledge-graph/facts/contextual`
- Auth: none declared

Get contextually relevant facts categorized by importance.

Returns facts in three categories:
1. workspace_facts: Facts about the user's own workspace/company
2. contact_facts: Facts about the specified contact (if provided)
3. other_facts: Other recent facts from the knowledge graph

This endpoint is optimized for the AI Agent Memory panel.

## Query parameters

- `contact_name` string, nullable: Current contact name to prioritize facts for
- `limit` integer: Max facts per category

## Response `200`

Successful Response

- ContextualFactsResponse: Response for contextual facts - categorized by relevance.
  - `workspace_facts` FactResponse[]: Facts about the user's workspace/company (from __workspace__ entity)
    - `id` integer, required
    - `entity_id` integer, required
    - `entity_name` string, nullable
    - `entity_type` string, nullable
    - `fact_key` string, required
    - `fact_value` string, required
    - `fact_type` string
    - `status` string
    - `confirmation_count` integer
    - `sensitivity` string
    - `first_message_id` integer, nullable
    - `last_message_id` integer, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
  - `contact_facts` FactResponse[]: Facts about the current contact in focus
    - `id` integer, required
    - `entity_id` integer, required
    - `entity_name` string, nullable
    - `entity_type` string, nullable
    - `fact_key` string, required
    - `fact_value` string, required
    - `fact_type` string
    - `status` string
    - `confirmation_count` integer
    - `sensitivity` string
    - `first_message_id` integer, nullable
    - `last_message_id` integer, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
  - `other_facts` FactResponse[]: Other recent facts from the knowledge graph
    - `id` integer, required
    - `entity_id` integer, required
    - `entity_name` string, nullable
    - `entity_type` string, nullable
    - `fact_key` string, required
    - `fact_value` string, required
    - `fact_type` string
    - `status` string
    - `confirmation_count` integer
    - `sensitivity` string
    - `first_message_id` integer, nullable
    - `last_message_id` integer, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
  - `contact_name` string, nullable: Name of the contact these facts are about
  - `contact_entity_id` integer, nullable: Entity ID of the contact (for adding new facts)
  - `workspace_entity_id` integer, nullable: Entity ID of the workspace (for adding new facts)
  - `total` integer: Total facts returned

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
