bdi-mental-states — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bdi-mental-states (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Attribution: Sourced from muratcankoylan/Agent-Skills-for-Context-Engineering by Muratcan Koylan.
Transform external RDF context into agent mental states (beliefs, desires, intentions) using formal BDI ontology patterns. This skill enables agents to reason about context through cognitive architecture, supporting deliberative reasoning, explainability, and semantic interoperability within multi-agent systems.
Activate this skill when:
Separate mental states into two ontological categories because BDI reasoning requires distinguishing what persists from what happens:
Mental States (Endurants) -- model these as persistent cognitive attributes that hold over time intervals:
Belief: Represent what the agent holds true about the world. Ground every belief in a world state reference.Desire: Represent what the agent wishes to bring about. Link each desire back to the beliefs that motivate it.Intention: Represent what the agent commits to achieving. An intention must fulfil a desire and specify a plan.Mental Processes (Perdurants) -- model these as events that create or modify mental states, because tracking causal transitions enables explainability:
BeliefProcess: Triggers belief formation/update from perception. Always connect to a generating world state.DesireProcess: Generates desires from existing beliefs. Preserves the motivational chain.IntentionProcess: Commits to selected desires as actionable intentions.Wire beliefs, desires, and intentions into directed chains using bidirectional properties (motivates/isMotivatedBy, fulfils/isFulfilledBy) because this enables both forward reasoning (what should the agent do?) and backward tracing (why did the agent act?):
:Belief_store_open a bdi:Belief ;
rdfs:comment "Store is open" ;
bdi:motivates :Desire_buy_groceries .
:Desire_buy_groceries a bdi:Desire ;
rdfs:comment "I desire to buy groceries" ;
bdi:isMotivatedBy :Belief_store_open .
:Intention_go_shopping a bdi:Intention ;
rdfs:comment "I will buy groceries" ;
bdi:fulfils :Desire_buy_groceries ;
bdi:isSupportedBy :Belief_store_open ;
bdi:specifies :Plan_shopping .Always ground mental states in world state references rather than free-text descriptions, because ungrounded beliefs break semantic querying and cross-agent interoperability:
:Agent_A a bdi:Agent ;
bdi:perceives :WorldState_WS1 ;
bdi:hasMentalState :Belief_B1 .
:WorldState_WS1 a bdi:WorldState ;
rdfs:comment "Meeting scheduled at 10am in Room 5" ;
bdi:atTime :TimeInstant_10am .
:Belief_B1 a bdi:Belief ;
bdi:refersTo :WorldState_WS1 .Connect intentions to plans via bdi:specifies, and decompose plans into ordered task sequences using bdi:precedes, because this separation allows plan reuse across different intentions while keeping execution order explicit:
:Intention_I1 bdi:specifies :Plan_P1 .
:Plan_P1 a bdi:Plan ;
bdi:addresses :Goal_G1 ;
bdi:beginsWith :Task_T1 ;
bdi:endsWith :Task_T3 .
:Task_T1 bdi:precedes :Task_T2 .
:Task_T2 bdi:precedes :Task_T3 .Implement Triples-to-Beliefs-to-Triples as a bidirectional pipeline because agents must both consume external RDF context and produce new RDF assertions. Structure every T2B2T implementation in two explicit phases:
Phase 1: Triples-to-Beliefs -- Translate incoming RDF triples into belief instances. Use bdi:triggers to connect the external world state to a BeliefProcess, and bdi:generates to produce the resulting belief. This preserves provenance from source data through to internal cognition:
:WorldState_notification a bdi:WorldState ;
rdfs:comment "Push notification: Payment request $250" ;
bdi:triggers :BeliefProcess_BP1 .
:BeliefProcess_BP1 a bdi:BeliefProcess ;
bdi:generates :Belief_payment_request .Phase 2: Beliefs-to-Triples -- After BDI deliberation selects an intention and executes a plan, project the results back into RDF using bdi:bringsAbout. This closes the loop so downstream systems can consume agent outputs as standard linked data:
:Intention_pay a bdi:Intention ;
bdi:specifies :Plan_payment .
:PlanExecution_PE1 a bdi:PlanExecution ;
bdi:satisfies :Plan_payment ;
bdi:bringsAbout :WorldState_payment_complete .Choose notation based on the C4 abstraction level being modeled, because mixing notations at the wrong level obscures rather than clarifies the cognitive architecture:
| C4 Level | Notation | Mental State Representation |
|---|---|---|
| L1 Context | ArchiMate | Agent boundaries, external perception sources |
| L2 Container | ArchiMate | BDI reasoning engine, belief store, plan executor |
| L3 Component | UML | Mental state managers, process handlers |
| L4 Code | UML/RDF | Belief/Desire/Intention classes, ontology instances |
Attach bdi:Justification instances to every mental entity using bdi:isJustifiedBy, because unjustified mental states make agent reasoning opaque and untraceable. Each justification should capture the evidence or rule that produced the mental state:
:Belief_B1 a bdi:Belief ;
bdi:isJustifiedBy :Justification_J1 .
:Justification_J1 a bdi:Justification ;
rdfs:comment "Official announcement received via email" .
:Intention_I1 a bdi:Intention ;
bdi:isJustifiedBy :Justification_J2 .
:Justification_J2 a bdi:Justification ;
rdfs:comment "Location precondition satisfied" .Assign validity intervals to every mental state using bdi:hasValidity with TimeInterval instances, because beliefs without temporal bounds cannot be garbage-collected or conflict-checked during diachronic reasoning:
:Belief_B1 a bdi:Belief ;
bdi:hasValidity :TimeInterval_TI1 .
:TimeInterval_TI1 a bdi:TimeInterval ;
bdi:hasStartTime :TimeInstant_9am ;
bdi:hasEndTime :TimeInstant_11am .Query mental states active at a specific moment using SPARQL temporal filters. Use this pattern to resolve conflicts when multiple beliefs about the same world state overlap in time:
SELECT ?mentalState WHERE {
?mentalState bdi:hasValidity ?interval .
?interval bdi:hasStartTime ?start ;
bdi:hasEndTime ?end .
FILTER(?start <= "2025-01-04T10:00:00"^^xsd:dateTime &&
?end >= "2025-01-04T10:00:00"^^xsd:dateTime)
}Decompose complex beliefs into constituent parts using bdi:hasPart relations, because monolithic beliefs force full replacement on partial updates. Structure composite beliefs so that each sub-belief can be independently updated, queried, or invalidated:
:Belief_meeting a bdi:Belief ;
rdfs:comment "Meeting at 10am in Room 5" ;
bdi:hasPart :Belief_meeting_time , :Belief_meeting_location .
# Update only location component without touching time
:BeliefProcess_update a bdi:BeliefProcess ;
bdi:modifies :Belief_meeting_location .Use LAG to constrain LLM outputs with ontological structure, because unconstrained generation produces triples that violate BDI class restrictions. Serialize the ontology into the prompt context, then validate generated triples against it before accepting them:
def augment_llm_with_bdi_ontology(prompt, ontology_graph):
ontology_context = serialize_ontology(ontology_graph, format='turtle')
augmented_prompt = f"{ontology_context}\n\n{prompt}"
response = llm.generate(augmented_prompt)
triples = extract_rdf_triples(response)
is_consistent = validate_triples(triples, ontology_graph)
return triples if is_consistent else retry_with_feedback()Translate BDI ontology patterns into executable production rules when deploying to rule-based agent platforms. Map each cognitive chain link (belief-to-desire, desire-to-intention) to a HEAD/CONDITIONALS/TAIL rule, because this preserves the deliberative semantics while enabling runtime execution:
% Belief triggers desire formation
[HEAD: belief(agent_a, store_open)] /
[CONDITIONALS: time(weekday_afternoon)] »
[TAIL: generate_desire(agent_a, buy_groceries)].
% Desire triggers intention commitment
[HEAD: desire(agent_a, buy_groceries)] /
[CONDITIONALS: belief(agent_a, has_shopping_list)] »
[TAIL: commit_intention(agent_a, buy_groceries)].hasPart relations for meronymic structures enabling selective belief updates.atTime or hasValidity.motivates/isMotivatedBy, generates/isGeneratedBy) for flexible querying.Justification instances for explainability and trust.BeliefProcess ⊑ ∃generates.Belief).Validate implementation against these SPARQL queries:
# CQ1: What beliefs motivated formation of a given desire?
SELECT ?belief WHERE {
:Desire_D1 bdi:isMotivatedBy ?belief .
}
# CQ2: Which desire does a particular intention fulfill?
SELECT ?desire WHERE {
:Intention_I1 bdi:fulfils ?desire .
}
# CQ3: Which mental process generated a belief?
SELECT ?process WHERE {
?process bdi:generates :Belief_B1 .
}
# CQ4: What is the ordered sequence of tasks in a plan?
SELECT ?task ?nextTask WHERE {
:Plan_P1 bdi:hasComponent ?task .
OPTIONAL { ?task bdi:precedes ?nextTask }
} ORDER BY ?taskbdi:refersTo, they are not world states themselves. Mixing them collapses the perception-cognition boundary and breaks SPARQL queries that filter by type.hasPart for complex beliefs. Monolithic beliefs force full replacement when only one attribute changes.Justification instances. Unjustified mental states cannot be audited or traced.Internal references:
Primary sources:
Created: 2026-01-07 Last Updated: 2026-03-17 Author: Agent Skills for Context Engineering Contributors Version: 2.0.0
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.