Core concepts

Threads and facts

Threads group related content inside an agent. Facts are what Recalld actually stores and returns after extraction.

Threads

A thread is one conversation, session, or document set. Attaching input to a thread keeps it grouped, and lets retrieval narrow to that conversation instead of the agent's whole history.

curl -X POST https://eu.recalld.ai/v1/agents/$AGENT_ID/threads \
  -H "Authorization: Bearer $RECALLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "'"$AGENT_ID"'"}'

You do not have to create threads up front. Passing a thread_id to ingest is enough, and omitting it entirely writes agent-global memory that every thread can see.

Thread-less facts are global

Content ingested without a thread_id produces facts attached to no thread. Those are visible from every thread of that agent. This is the right place for durable truths about a user, and the wrong place for anything specific to one conversation.

Reading a thread back

GET /v1/agents/{agent_id}/threads/{id}/messages returns the original messages projected from stored sources, not the extracted facts. Use it to show conversation history; use retrieval to answer questions.

Facts

Ingestion does not store your text as-is. It extracts discrete facts and compares them with existing memory. When new information conflicts with an older fact, Recalld can supersede it. Retrieval selects relevant facts instead of returning the full conversation history.

Fact kinds

KindRetrieval behaviour
KNOWLEDGEReturned when semantically relevant to the query. The default for most extracted content.
RULEAlways included in retrieval, relevance aside. Use for standing instructions.
PREFERENCEReturned when relevant to a choice. A soft weight rather than a hard constraint.

Source trust

Every fact remembers the kind of source that created it. A source can only alter facts created by an equal or lower trust source, which stops a scraped document from quietly overwriting something a user told you directly.

SourceTrustCan overwrite
SYSTEM100Immutable. Nothing can alter a SYSTEM fact, including SYSTEM.
USER80USER and below
AGENT60AGENT and below
TOOL40TOOL and below
DOCUMENT20DOCUMENT and CODE
CODE10CODE only

Writing facts directly

POST /v1/agents/{agent_id}/facts stores a fact verbatim, skipping extraction. It still costs credits, because the text has to be embedded. Supply source so the trust rules above apply.

curl -X POST https://eu.recalld.ai/v1/agents/$AGENT_ID/facts \
  -H "Authorization: Bearer $RECALLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "'"$AGENT_ID"'",
    "text": "Bob works in the Berlin office.",
    "source": "USER",
    "kind": "KNOWLEDGE"
  }'

Updating a fact regenerates its embedding and is subject to the same trust check: the source you send must be at least as trusted as the one that created the fact.