BDI Mental States

BDI Mental States

Teaches modelling agent mental states as beliefs, desires and intentions from RDF context using BDI ontology patterns for explainable, neuro-symbolic agents.

Skill files5 files

references/

SKILL.md374 lines
1
---
2
name: bdi-mental-states
3
description: "This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration."
4
---
5
6
# BDI Mental State Modeling
7
8
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.
9
10
## When to Activate
11
12
Activate this skill when:
13
- Processing external RDF context into agent beliefs about world states
14
- Modeling rational agency with perception, deliberation, and action cycles
15
- Enabling explainability through traceable reasoning chains
16
- Implementing BDI frameworks (SEMAS, JADE, JADEX)
17
- Augmenting LLMs with formal cognitive structures (Logic Augmented Generation)
18
- Coordinating mental states across multi-agent platforms
19
- Tracking temporal evolution of beliefs, desires, and intentions
20
- Linking motivational states to action plans
21
22
Do not activate this skill for adjacent work owned by other skills:
23
- General context-window explanations or attention mechanics: `context-fundamentals`.
24
- Persistent user, entity, or conversation memory without formal BDI state: `memory-systems`.
25
- Supervisor, swarm, or handoff topology decisions: `multi-agent-patterns`.
26
- General agent evaluation rubrics or quality gates: `evaluation`.
27
28
## Core Concepts
29
30
### Mental Reality Architecture
31
32
Separate mental states into two ontological categories because BDI reasoning requires distinguishing what persists from what happens:
33
34
**Mental States (Endurants)** -- model these as persistent cognitive attributes that hold over time intervals:
35
- `Belief`: Represent what the agent holds true about the world. Ground every belief in a world state reference.
36
- `Desire`: Represent what the agent wishes to bring about. Link each desire back to the beliefs that motivate it.
37
- `Intention`: Represent what the agent commits to achieving. An intention must fulfil a desire and specify a plan.
38
39
**Mental Processes (Perdurants)** -- model these as events that create or modify mental states, because tracking causal transitions enables explainability:
40
- `BeliefProcess`: Triggers belief formation/update from perception. Always connect to a generating world state.
41
- `DesireProcess`: Generates desires from existing beliefs. Preserves the motivational chain.
42
- `IntentionProcess`: Commits to selected desires as actionable intentions.
43
44
### Cognitive Chain Pattern
45
46
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?):
47
48
```turtle
49
:Belief_store_open a bdi:Belief ;
50
rdfs:comment "Store is open" ;
51
bdi:motivates :Desire_buy_groceries .
52
53
:Desire_buy_groceries a bdi:Desire ;
54
rdfs:comment "I desire to buy groceries" ;
55
bdi:isMotivatedBy :Belief_store_open .
56
57
:Intention_go_shopping a bdi:Intention ;
58
rdfs:comment "I will buy groceries" ;
59
bdi:fulfils :Desire_buy_groceries ;
60
bdi:isSupportedBy :Belief_store_open ;
61
bdi:specifies :Plan_shopping .
62
```
63
64
### World State Grounding
65
66
Always ground mental states in world state references rather than free-text descriptions, because ungrounded beliefs break semantic querying and cross-agent interoperability:
67
68
```turtle
69
:Agent_A a bdi:Agent ;
70
bdi:perceives :WorldState_WS1 ;
71
bdi:hasMentalState :Belief_B1 .
72
73
:WorldState_WS1 a bdi:WorldState ;
74
rdfs:comment "Meeting scheduled at 10am in Room 5" ;
75
bdi:atTime :TimeInstant_10am .
76
77
:Belief_B1 a bdi:Belief ;
78
bdi:refersTo :WorldState_WS1 .
79
```
80
81
### Goal-Directed Planning
82
83
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:
84
85
```turtle
86
:Intention_I1 bdi:specifies :Plan_P1 .
87
88
:Plan_P1 a bdi:Plan ;
89
bdi:addresses :Goal_G1 ;
90
bdi:beginsWith :Task_T1 ;
91
bdi:endsWith :Task_T3 .
92
93
:Task_T1 bdi:precedes :Task_T2 .
94
:Task_T2 bdi:precedes :Task_T3 .
95
```
96
97
### T2B2T Paradigm
98
99
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:
100
101
**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:
102
```turtle
103
:WorldState_notification a bdi:WorldState ;
104
rdfs:comment "Push notification: Payment request $250" ;
105
bdi:triggers :BeliefProcess_BP1 .
106
107
:BeliefProcess_BP1 a bdi:BeliefProcess ;
108
bdi:generates :Belief_payment_request .
109
```
110
111
**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:
112
```turtle
113
:Intention_pay a bdi:Intention ;
114
bdi:specifies :Plan_payment .
115
116
:PlanExecution_PE1 a bdi:PlanExecution ;
117
bdi:satisfies :Plan_payment ;
118
bdi:bringsAbout :WorldState_payment_complete .
119
```
120
121
### Notation Selection by Level
122
123
Choose notation based on the C4 abstraction level being modeled, because mixing notations at the wrong level obscures rather than clarifies the cognitive architecture:
124
125
| C4 Level | Notation | Mental State Representation |
126
|----------|----------|----------------------------|
127
| L1 Context | ArchiMate | Agent boundaries, external perception sources |
128
| L2 Container | ArchiMate | BDI reasoning engine, belief store, plan executor |
129
| L3 Component | UML | Mental state managers, process handlers |
130
| L4 Code | UML/RDF | Belief/Desire/Intention classes, ontology instances |
131
132
### Justification and Explainability
133
134
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:
135
136
```turtle
137
:Belief_B1 a bdi:Belief ;
138
bdi:isJustifiedBy :Justification_J1 .
139
140
:Justification_J1 a bdi:Justification ;
141
rdfs:comment "Official announcement received via email" .
142
143
:Intention_I1 a bdi:Intention ;
144
bdi:isJustifiedBy :Justification_J2 .
145
146
:Justification_J2 a bdi:Justification ;
147
rdfs:comment "Location precondition satisfied" .
148
```
149
150
### Temporal Dimensions
151
152
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:
153
154
```turtle
155
:Belief_B1 a bdi:Belief ;
156
bdi:hasValidity :TimeInterval_TI1 .
157
158
:TimeInterval_TI1 a bdi:TimeInterval ;
159
bdi:hasStartTime :TimeInstant_9am ;
160
bdi:hasEndTime :TimeInstant_11am .
161
```
162
163
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:
164
165
```sparql
166
SELECT ?mentalState WHERE {
167
?mentalState bdi:hasValidity ?interval .
168
?interval bdi:hasStartTime ?start ;
169
bdi:hasEndTime ?end .
170
FILTER(?start <= "2025-01-04T10:00:00"^^xsd:dateTime &&
171
?end >= "2025-01-04T10:00:00"^^xsd:dateTime)
172
}
173
```
174
175
### Compositional Mental Entities
176
177
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:
178
179
```turtle
180
:Belief_meeting a bdi:Belief ;
181
rdfs:comment "Meeting at 10am in Room 5" ;
182
bdi:hasPart :Belief_meeting_time , :Belief_meeting_location .
183
184
# Update only location component without touching time
185
:BeliefProcess_update a bdi:BeliefProcess ;
186
bdi:modifies :Belief_meeting_location .
187
```
188
189
## Practical Guidance
190
191
### Build a BDI Model in Six Passes
192
193
Use this workflow when converting external semantic context into a BDI representation:
194
195
1. **Define the world-state substrate**: Identify the external facts or events the agent can perceive. Model these as world states before creating beliefs.
196
2. **Create belief instances**: Translate each relevant world state into a belief with provenance, temporal validity, and a justification reference.
197
3. **Derive desires from beliefs**: Add desires only when a belief creates a goal-relevant motivation. Link each desire to the belief that motivates it.
198
4. **Commit intentions deliberately**: Promote a desire to an intention only when the agent commits to a plan. Record the selected plan and preconditions.
199
5. **Project action results back to triples**: After execution, emit resulting world states as RDF so downstream systems can consume the new state.
200
6. **Validate with competency questions**: Query for provenance, motivation, plan sequence, and active validity windows before trusting the model.
201
202
### Keep the Ontology Small
203
204
Start with `Agent`, `WorldState`, `Belief`, `Desire`, `Intention`, `Plan`, `Task`, `Justification`, and `TimeInterval`. Add specialized classes only after competency questions prove the core model cannot answer required queries. A compact ontology is easier to serialize into prompts, easier to validate, and less likely to create brittle reasoning chains.
205
206
### Use BDI Only When Mental-State Semantics Matter
207
208
BDI modeling is justified when the system needs explainable agency: why an agent believed something, what desire that belief created, which intention was selected, and what plan executed. If the system only needs to remember facts across sessions, use `memory-systems`. If it only needs to split work across agents, use `multi-agent-patterns`.
209
210
## Detailed Topics
211
212
### Integration Patterns
213
214
### Logic Augmented Generation (LAG)
215
216
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:
217
218
```python
219
def augment_llm_with_bdi_ontology(prompt, ontology_graph):
220
ontology_context = serialize_ontology(ontology_graph, format='turtle')
221
augmented_prompt = f"{ontology_context}\n\n{prompt}"
222
223
response = llm.generate(augmented_prompt)
224
triples = extract_rdf_triples(response)
225
226
is_consistent = validate_triples(triples, ontology_graph)
227
return triples if is_consistent else retry_with_feedback()
228
```
229
230
### SEMAS Rule Translation
231
232
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:
233
234
```prolog
235
% Belief triggers desire formation
236
[HEAD: belief(agent_a, store_open)] /
237
[CONDITIONALS: time(weekday_afternoon)] »
238
[TAIL: generate_desire(agent_a, buy_groceries)].
239
240
% Desire triggers intention commitment
241
[HEAD: desire(agent_a, buy_groceries)] /
242
[CONDITIONALS: belief(agent_a, has_shopping_list)] »
243
[TAIL: commit_intention(agent_a, buy_groceries)].
244
```
245
246
## Guidelines
247
248
1. Model world states as configurations independent of agent perspectives, providing referential substrate for mental states.
249
250
2. Distinguish endurants (persistent mental states) from perdurants (temporal mental processes), aligning with DOLCE ontology.
251
252
3. Treat goals as descriptions rather than mental states, maintaining separation between cognitive and planning layers.
253
254
4. Use `hasPart` relations for meronymic structures enabling selective belief updates.
255
256
5. Associate every mental entity with temporal constructs via `atTime` or `hasValidity`.
257
258
6. Use bidirectional property pairs (`motivates`/`isMotivatedBy`, `generates`/`isGeneratedBy`) for flexible querying.
259
260
7. Link mental entities to `Justification` instances for explainability and trust.
261
262
8. Implement T2B2T through: (1) translate RDF to beliefs, (2) execute BDI reasoning, (3) project mental states back to RDF.
263
264
9. Define existential restrictions on mental processes (e.g., `BeliefProcess ⊑ ∃generates.Belief`).
265
266
10. Reuse established ODPs (EventCore, Situation, TimeIndexedSituation, BasicPlan, Provenance) for interoperability.
267
268
## Competency Questions
269
270
Validate implementation against these SPARQL queries:
271
272
```sparql
273
# CQ1: What beliefs motivated formation of a given desire?
274
SELECT ?belief WHERE {
275
:Desire_D1 bdi:isMotivatedBy ?belief .
276
}
277
278
# CQ2: Which desire does a particular intention fulfill?
279
SELECT ?desire WHERE {
280
:Intention_I1 bdi:fulfils ?desire .
281
}
282
283
# CQ3: Which mental process generated a belief?
284
SELECT ?process WHERE {
285
?process bdi:generates :Belief_B1 .
286
}
287
288
# CQ4: What is the ordered sequence of tasks in a plan?
289
SELECT ?task ?nextTask WHERE {
290
:Plan_P1 bdi:hasComponent ?task .
291
OPTIONAL { ?task bdi:precedes ?nextTask }
292
} ORDER BY ?task
293
```
294
295
## Examples
296
297
**Example 1: RDF notification to BDI chain**
298
299
Input world state:
300
301
```turtle
302
:WorldState_invoice_due a bdi:WorldState ;
303
rdfs:comment "Invoice INV-42 is due tomorrow" ;
304
bdi:atTime :Time_2026_05_15 .
305
```
306
307
BDI projection:
308
309
```turtle
310
:Belief_invoice_due a bdi:Belief ;
311
bdi:refersTo :WorldState_invoice_due ;
312
bdi:isJustifiedBy :Justification_billing_system ;
313
bdi:motivates :Desire_avoid_late_fee .
314
315
:Desire_avoid_late_fee a bdi:Desire ;
316
bdi:isMotivatedBy :Belief_invoice_due .
317
318
:Intention_pay_invoice a bdi:Intention ;
319
bdi:fulfils :Desire_avoid_late_fee ;
320
bdi:specifies :Plan_pay_invoice .
321
```
322
323
**Example 2: Boundary decision**
324
325
If the task is "remember that Alice prefers concise summaries," use `memory-systems`. If the task is "represent why the agent believes Alice needs a summary, what goal that creates, and which plan it commits to," use this skill.
326
327
## Gotchas
328
329
1. **Conflating mental states with world states**: Mental states reference world states via `bdi:refersTo`, they are not world states themselves. Mixing them collapses the perception-cognition boundary and breaks SPARQL queries that filter by type.
330
331
2. **Missing temporal bounds**: Every mental state needs validity intervals for diachronic reasoning. Without them, stale beliefs persist indefinitely and conflict detection becomes impossible.
332
333
3. **Flat belief structures**: Use compositional modeling with `hasPart` for complex beliefs. Monolithic beliefs force full replacement when only one attribute changes.
334
335
4. **Implicit justifications**: Always link mental entities to explicit `Justification` instances. Unjustified mental states cannot be audited or traced.
336
337
5. **Direct intention-to-action mapping**: Intentions specify plans which contain tasks; actions execute tasks. Skipping the plan layer removes the ability to reuse, reorder, or share execution strategies.
338
339
6. **Ontology over-complexity**: Start with 5-10 core classes and properties (Belief, Desire, Intention, WorldState, Plan, plus key relations). Expanding the ontology prematurely inflates prompt context and slows SPARQL queries without improving reasoning quality.
340
341
7. **Reasoning cost explosion**: Keep belief chains to 3 levels or fewer (belief -> desire -> intention). Deeper chains become prohibitively expensive for LLM inference and rarely improve decision quality over shallower alternatives.
342
343
## Integration
344
345
This skill owns formal mental-state modeling. Adjacent skills own different layers:
346
347
- `memory-systems`: persistent facts, entity memory, and temporal knowledge graphs without BDI belief/desire/intention semantics.
348
- `multi-agent-patterns`: agent topology, handoff protocols, and coordination between agents.
349
- `evaluation`: competency questions, regression checks, and quality gates for BDI implementations.
350
- `context-fundamentals`: conceptual context-window and attention mechanics that inform prompt construction.
351
- `tool-design`: schema and tool contracts for BDI query, validation, or projection tools.
352
353
## References
354
355
Internal references:
356
- [BDI Ontology Core](./references/bdi-ontology-core.md) - Read when: implementing BDI class hierarchies or defining ontology properties from scratch
357
- [RDF Examples](./references/rdf-examples.md) - Read when: writing Turtle serializations of mental states or debugging triple structure
358
- [SPARQL Competency Queries](./references/sparql-competency.md) - Read when: validating an implementation against competency questions or building custom queries
359
- [Framework Integration](./references/framework-integration.md) - Read when: deploying BDI models to SEMAS, JADE, or LAG pipelines
360
361
Primary sources:
362
- Zuppiroli et al. "The Belief-Desire-Intention Ontology" (2025) — Read when: implementing formal BDI class hierarchies or validating ontology alignment
363
- Rao & Georgeff "BDI agents: From theory to practice" (1995) — Read when: understanding the theoretical foundations of practical reasoning agents
364
- Bratman "Intention, plans, and practical reason" (1987) — Read when: grounding implementation decisions in the philosophical basis of intentionality
365
366
---
367
368
## Skill Metadata
369
370
**Created**: 2026-01-07
371
**Last Updated**: 2026-05-15
372
**Author**: Agent Skills for Context Engineering Contributors
373
**Version**: 2.1.0
374

© Context Engineering Agent Skills Contributors · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…