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.
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.
Core insight: BDI modeling gives agents traceable reasoning chains -- every belief links to a justification, every desire to motivating beliefs, every intention to fulfilling desires.
What is the primary goal?
+-- Explainability and traceability --> Full BDI ontology with Justification instances
+-- Bidirectional RDF integration --> T2B2T paradigm (Triples-to-Beliefs-to-Triples)
+-- LLM augmentation with constraints --> Logic Augmented Generation (LAG)
+-- Executable agent behavior --> SEMAS rule translation from BDI to production rules
+-- All of the above --> Combine approaches; each addresses different concernMental States (Endurants): Persistent cognitive attributes
Belief: What the agent believes to be true about the worldDesire: What the agent wishes to bring aboutIntention: What the agent commits to achievingMental Processes (Perdurants): Events that modify mental states
BeliefProcess: Forming/updating beliefs from perceptionDesireProcess: Generating desires from beliefsIntentionProcess: Committing to desires as actionable intentions: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 .Mental states reference structured configurations of the environment:
: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 .Intentions specify plans that address goals through task sequences:
: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 .Triples-to-Beliefs-to-Triples implements bidirectional flow between RDF knowledge graphs and internal mental states:
Phase 1: Triples-to-Beliefs -- External RDF context triggers belief formation.
: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 -- Mental deliberation produces new RDF output.
:Intention_pay a bdi:Intention ;
bdi:specifies :Plan_payment .
:PlanExecution_PE1 a bdi:PlanExecution ;
bdi:satisfies :Plan_payment ;
bdi:bringsAbout :WorldState_payment_complete .| 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 |
:Belief_B1 a bdi:Belief ;
bdi:isJustifiedBy :Justification_J1 .
:Justification_J1 a bdi:Justification ;
rdfs:comment "Official announcement received via email" .: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 specific moments:
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)
}Complex mental entities decompose into constituent parts for selective updates:
: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
:BeliefProcess_update a bdi:BeliefProcess ;
bdi:modifies :Belief_meeting_location .Augment LLM outputs with ontological constraints:
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()Map BDI ontology to executable production rules:
% 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)].| Anti-Pattern | Problem | Solution |
|---|---|---|
| Conflating mental states with world states | Mental states reference world states, they are not world states themselves | Always link beliefs to WorldState instances via refersTo |
| Missing temporal bounds | Cannot reason about when beliefs are valid | Every mental state should have validity intervals via hasValidity |
| Flat belief structures | Cannot update parts of complex beliefs independently | Use compositional modeling with hasPart |
| Implicit justifications | No traceability for why agents believe something | Always link mental entities to explicit Justification instances |
| Direct intention-to-action mapping | Bypasses plan structure, loses task ordering | Intentions specify plans which contain tasks; actions execute tasks |
| Unidirectional property chains | Cannot query in both directions (e.g., "what does this belief motivate?") | Use bidirectional property pairs (motivates/isMotivatedBy) |
| Goals as mental states | Goals are descriptions, not cognitive states | Treat goals as separate descriptions; maintain separation between cognitive and planning layers |
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 ?taskhasPart relations for meronymic structures enabling selective updatesatTime or hasValidityBeliefProcess ⊑ ∃generates.Belief)See references/ folder for detailed documentation:
bdi-ontology-core.md - Core ontology patterns and class definitionsrdf-examples.md - Complete RDF/Turtle examplessparql-competency.md - Full competency question SPARQL queriesframework-integration.md - SEMAS, JADE, LAG integration patternsPrimary sources:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.