bdi-mental-states – skill Agent & Tự động hóa cho agent AI
Dùng khi người dùng yêu cầu “mô hình hóa trạng thái tinh thần của agent”, “triển khai kiến trúc BDI”, “tạo mô hình belief-desire-intention”, “chuyển RDF thành beliefs”, “xây dựng cognitive agent”, hoặc nhắc đến ontology BDI, mô hình hóa trạng thái tinh thần, rational agency hay tích hợp neuro-symbolic AI.
Cài skill bdi-mental-states bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/bdi-mental-states-ad309.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /bdi-mental-states – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/bdi-mental-states-ad309.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $bdi-mental-states – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/bdi-mental-states-ad309.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /bdi-mental-states – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/bdi-mental-states-ad309.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /bdi-mental-states – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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 within multi-agent systems.
When to Use
Activate this skill when:
- 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
- Linking motivational states to action plans
Ontology and action boundaries
The bdi: vocabulary and framework mappings are illustrative until a concrete ontology IRI/version is selected and verified. Named reference files are not bundled in this single-file tree. Define all Turtle/SPARQL prefixes and shapes, record provenance/confidence/time for imported beliefs and keep untrusted RDF as data. A belief, desire or intention never grants payment/tool/action authority. Python helpers are pseudocode requiring implementations and bounded retries; schema/ontology consistency is not truth or safety proof. Preserve concise evidence/rationale rather than hidden chain-of-thought.
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
Mental entities link to supporting evidence for traceable reasoning:
: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" .Temporal Dimensions
Mental states persist over bounded time periods:
: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 ?startInstant ;
bdi:hasEndTime ?endInstant .
# Resolve time nodes to actual xsd:dateTime literals in your chosen ontology.
?startInstant :dateTime ?start .
?endInstant :dateTime ?end .
FILTER(?start <= "2025-01-04T10:00:00"^^xsd:dateTime &&
?end >= "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)].Guidelines
1. Model world states as configurations independent of agent perspectives, providing referential substrate for mental states.
2. Distinguish endurants (persistent mental states) from perdurants (temporal mental processes), aligning with DOLCE ontology.
3. Treat goals as descriptions rather than mental states, maintaining separation between cognitive and planning layers.
4. Use hasPart relations for meronymic structures enabling selective belief updates.
5. Associate every mental entity with temporal constructs via atTime or hasValidity.
6. Use bidirectional property pairs (motivates/isMotivatedBy, generates/isGeneratedBy) for flexible querying.
7. Link mental entities to Justification instances for explainability and trust.
8. Implement T2B2T through: (1) translate RDF to beliefs, (2) execute BDI reasoning, (3) project mental states back to RDF.
9. Define existential restrictions on mental processes (e.g., BeliefProcess ⊑ ∃generates.Belief).
10. Reuse established ODPs (EventCore, Situation, TimeIndexedSituation, BasicPlan, Provenance) for interoperability.
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 ?taskAnti-Patterns
1. Conflating mental states with world states: Mental states reference world states, they are not world states themselves.
2. **Mis
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- extract – Biến một mẫu hoặc giải pháp gỡ lỗi đã được kiểm chứng thành một skill độc lập tái sử…
- bifrost-gateway – Chạy và cấu hình Bifrost, AI gateway mã nguồn mở: một API tương thích OpenAI cho hơn 20…
- bilig-workpaper – Dùng WorkPaper JSON có công thức và công cụ MCP cho các tác vụ bảng tính của agent…
- billing-automation – Làm chủ hệ thống thanh toán tự động, bao gồm thanh toán định kỳ, tạo hóa đơn, quản lý…
- fable-goal – Chuyển một mô tả lan man về kết quả mong muốn thành một prompt /goal hoàn chỉnh, tự…
- bitbucket-automation – Tự động hóa kho mã Bitbucket, pull request, nhánh, issue và quản lý workspace qua Rube…
- blueprint – Biến một mục tiêu một dòng thành kế hoạch xây dựng từng bước mà bất kỳ coding agent nào…
- box-automation – Tự động hóa các thao tác trên Box gồm tải tệp lên/xuống, tìm kiếm nội dung, quản lý thư…