Skip to content
Navigation

Add data to the memory graph

Add arbitrary data (text, JSON, or message) to a knowledge graph.

Target exactly one scope: agent_id writes to the calling user's memory (shared agents write to the shared graph, agent-scoped agents to their own); graph_id writes to a shared namespace and requires a service token. Processing is asynchronous — entity extraction and relationship building happen in the background. Returns 202 immediately.

POST
https://truememory-api.mvstg.com/memories/graph
View as Markdown

Authorization

  • HTTPBearerHTTPrequired

Header parameters

  • X-On-Behalf-Ofoptional

    One of the following:

    • string
    • null
  • X-External-User-Idoptional

    One of the following:

    • string
    • null
  • X-App-Idoptional

    One of the following:

    • string
    • null

Request bodyJSONrequired

  • datastringrequired
    maxLength: 50000
  • typemessageorjsonortextordocumentornoteortranscriberequired

    Content shape; selects the extraction rules and nothing else. In a user scope, message is one user turn and is stored like a chat exchange (see assistant_message). document is a note or document the user brought in whole (note is accepted as its older name).

  • agent_idoptional

    Target the calling user's memory, scoped by this agent. Provide exactly one of agent_id or graph_id.

    One of the following:

    • string
    • null
  • graph_idoptional

    Target a shared namespace instead of user memory. Requires a service token.

    One of the following:

    • string
    • null
  • source_descriptionoptional

    One of the following:

    • string
    • null
  • created_atoptional

    One of the following:

    • string
    • null
  • assistant_messageoptional

    For a user-scope type=message only: the assistant turn that answered data. Stored with it as one exchange so extraction reads the turn in context.

    One of the following:

    • string
    • null
  • waitoptionalboolean

    When true, wait for processing to complete before responding.

    default: false

Returns

200

Ingestion finished inline (wait=true).

JSON
  • statusoptionalstring
    default: "completed"

202

Ingestion was queued; poll the job for completion.

JSON
  • job_idstringrequired

    Poll GET /memories/graph/status/{job_id} with this.

  • statusoptionalstring
    default: "processing"

422

Validation Error
JSON
  • detailoptionalarray ofobject
    • locarray ofrequired

      One of the following:

      • string
      • integer
    • msgstringrequired
    • typestringrequired
    • inputoptionalunknown
    • ctxoptionalobject

Type to search…

↑↓ navigate↵ selectEsc close