Install
$ agentstack add skill-viktorbezdek-skillstack-bdi-mental-states ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
BDI Mental State Modeling
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.
When to Activate
- Processing external RDF context into agent beliefs about world states
- Modeling rational agency with perception, deliberation, and action cycles
- Enabling explainability through traceable reasoning chains
- Implementing BDI frameworks (SEMAS, JADE, JADEX)
- Augmenting LLMs with formal cognitive structures (Logic Augmented Generation)
- Coordinating mental states across multi-agent platforms
- Tracking temporal evolution of beliefs, desires, and intentions
Decision Tree: BDI Modeling Approach
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 concern
Core Concepts
Mental Reality Architecture
Mental 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 achieving
Mental Processes (Perdurants): Events that modify mental states
BeliefProcess: Forming/updating beliefs from perceptionDesireProcess: Generating desires from beliefsIntentionProcess: Committing to desires as actionable intentions
Cognitive Chain Pattern
: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 .
World State Grounding
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 .
Goal-Directed Planning
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 .
T2B2T Paradigm
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 .
Notation Selection by Level
| 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 |
Justification and Explainability
:Belief_B1 a bdi:Belief ;
bdi:isJustifiedBy :Justification_J1 .
:Justification_J1 a bdi:Justification ;
rdfs:comment "Official announcement received via email" .
Temporal Dimensions
: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)
}
Compositional Mental Entities
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 .
Integration Patterns
Logic Augmented Generation (LAG)
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()
SEMAS Rule Translation
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-Patterns
| 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 |
Competency Questions
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 ?task
Guidelines
- Model world states as configurations independent of agent perspectives
- Distinguish endurants (persistent mental states) from perdurants (temporal mental processes)
- Treat goals as descriptions rather than mental states
- Use
hasPartrelations for meronymic structures enabling selective updates - Associate every mental entity with temporal constructs via
atTimeorhasValidity - Use bidirectional property pairs for flexible querying
- Link mental entities to Justification instances for explainability
- Implement T2B2T for bidirectional RDF integration
- Define existential restrictions on mental processes (e.g.,
BeliefProcess ⊑ ∃generates.Belief) - Reuse established ODPs (EventCore, Situation, TimeIndexedSituation, BasicPlan, Provenance) for interoperability
Integration
- RDF Processing: Apply after parsing external RDF context to construct cognitive representations
- Semantic Reasoning: Combine with ontology reasoning to infer implicit mental state relationships
- Multi-Agent Communication: Integrate with FIPA ACL for cross-platform belief sharing
- Temporal Context: Coordinate with temporal reasoning for mental state evolution
- Explainable AI: Feed into explanation systems tracing perception through deliberation to action
- Neuro-Symbolic AI: Apply in LAG pipelines to constrain LLM outputs with cognitive structures
References
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 patterns
Primary sources:
- Zuppiroli et al. "The Belief-Desire-Intention Ontology" (2025)
- Rao & Georgeff "BDI agents: From theory to practice" (1995)
- Bratman "Intention, plans, and practical reason" (1987)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: viktorbezdek
- Source: viktorbezdek/skillstack
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.