Sources
Sources identify who created an event. They control how LocusGraph weights and links the resulting knowledge so validated, human-confirmed learnings stay at the front.
Why Source Matters
Two events can share the same payload and still mean different things. A decision made by the agent is one signal. The same decision corrected by a user is a different, stronger signal. LocusGraph uses the source field to keep that distinction in the graph instead of flattening every voice into the same vector.
Source Types
agent
The AI agent itself produced this knowledge — a decision it made, a fact it learned, or an observation during processing. Most events use this source.
{ "source": "agent", "event_kind": "decision", "payload": { "topic": "database_choice", "value": "PostgreSQL" } }user
Input from a human. Feedback, corrections, preferences, or direct instructions. User-sourced knowledge carries high trust weight in retrieval because it represents validated ground truth.
{ "source": "user", "event_kind": "feedback", "payload": { "topic": "response_quality", "value": "too verbose" } }system
System-level events: lifecycle signals, configuration changes, health checks. Typically paired with routine or observation event kinds.
{ "source": "system", "event_kind": "routine", "payload": { "topic": "health_check", "value": "all services healthy" } }validator
A runtime validator detected something — a constraint violation, a rule trigger, or a validation result. Events from validators often auto-create derived_from links so the agent can trace why a piece of knowledge exists.
{ "source": "validator", "event_kind": "constraint_violation", "payload": { "topic": "rate_limit", "value": "exceeded 1000 req/min" } }executor
A task executor completed work. Use when a background job, pipeline step, or automated process finishes.
{ "source": "executor", "event_kind": "action", "payload": { "topic": "deployment", "value": "v2.3 deployed to production" } }How Sources Shape Knowledge
Sources influence two things:
-
Retrieval weight. User-sourced knowledge ranks higher by default. Agent and executor sources rank equally. System and validator sources rank lower unless specifically queried. This keeps validated, human-confirmed knowledge at the forefront.
-
Link inference. The admission pipeline considers the source when auto-creating links. Validator events generate
derived_fromlinks. Agent decisions generaterelated_tolinks to recent context.
You can override default source weighting in retrieval by passing explicit filters. See the retrieval API for details.