Skip to content
Docs menu

Tool reference · Knowledge graph & temporal facts

kg_add_fact

Records a dated fact as subject, predicate, object, and by default closes any earlier fact with the same subject and predicate.

local stdio server writes

When to use

  • An architectural choice changed, for example the queue moved from Redis to RabbitMQ.
  • You want to be able to ask later what was true on a given date.
  • You want a clear history of a setting or dependency instead of overwriting notes.

Parameters

NameTypeDefaultDescription
subjectrequired string — —
predicaterequired string — —
objectrequired string — —
confidence number 1 —
context string — —
project string "general" —
invalidate_previous boolean true —
valid_from string — ISO 8601 time the fact became true; default now. Back-dated facts close and are closed by their neighbours.

Example

Arguments

{
  "subject": "my-api",
  "predicate": "uses_queue",
  "object": "rabbitmq",
  "context": "Switched from Redis streams for delivery guarantees",
  "project": "my-api"
}

Result shape

{
  "assertion_id": "5e0b7d2c9a1f4e3b8c6d0a2f4b6e8c1d"
}

Adding the exact same fact again returns the id of the existing open assertion instead of creating a duplicate.

Values are illustrative; the keys follow the server's handler. MCP clients receive the result as JSON text content.

Server description

The description the server sends to your agent in tools/list, captured from the v14.7.0 source:

Record a temporal fact assertion (subject, predicate, object). Supersedes any prior assertion with same (s,p) and different object — full history is preserved. Use for evolving architectural decisions.

Found a mistake? Open an issue on GitHub.

Search