Micro-ACT-R 的 topological-mapper:为认知 OS 流水线构建范畴论图网络
ao-labs-123/topological-mapper
Micro-ACT-R 项目发布流水线第二阶段 topological-mapper,将上游封装的粒子对象(particles.json)映射为 Entity 或 Event 节点,并自动连上 Cause、Action、Relation 等范畴论态射,输出 topological_graph.json。
Micro—ACT-R (tentative)
"ACT-R at a Micro-Scale"
What makes this different from standard ACT-R?
Standard ACT-R operates on a macro level with production rules. This project zooms into the micro-level of cognitive processing.
Overview
Micro–ACT-R operates through a clear, fully explainable pipeline from input to reasoning and execution:
First, text is acquired from the Environment and parsed in the Input stage into individual cognitive particles (Particle Encapsulation).
Next, during Reasoning, the system uses Topological Mapping to define relationships between particles and assigns explicit spatial coordinates via Spatial Allocation. These coordinates are logged directly into Storage.
The system then validates consistency between the category of knowledge and past experiences (Match & Select), selects the appropriate action based on this consistency (Execution), and finally produces the Output.
Micro-ACT-R Pipeline Architecture
- input-parser
- particle-encapsulation
- topological-mapper※Current Position
Current Phase: topological-mapper
Stage 2 of the Cognitive OS Pipeline
Constructs category-theoretic graph networks topological_graph.json from encapsulated particle objects data/particles.json.
Overview
This repository handles the Topological Mapping phase of the deterministic Cognitive OS.
It ingests discrete Particle objects, maps them into Entities or Events, and automatically wires category-theoretic morphisms (Cause, Action, Relation,) between them.
Pipeline Position
(Particle Encapsulation) ──> [ particles.json ] ──> [ Topological Mapping ] ──> [ topological_graph.json ]
Topology & Graph Design
1. Architectural Diagram
[ Category of Entities ] [ Category of Events ]
( Who / Subject / Agent ) ( What / Cause / Effect )
└── 5W1H: Who └── 5W1H: What
│ │
├─────────────── [ Morphisms ] ───────────┤
│ ( Action / Cause ) │
│ │
└───────── [ Context Attributes ] ────────┘
( When / Where / Why / How )
2. Node & Edge Definitions
Nodes (Objects)
- Entity: Agents, Subjects, and Nouns (
He,I,you, etc.)- Primary 5W1H Role:
Who
- Primary 5W1H Role:
- Event: Actions, Causes, and Contextual Events (
the project,i succeeded, etc.)- Primary 5W1H Role:
What(and contextual occurrences)
- Primary 5W1H Role:
Edges (Morphisms / Wires)
source: Domain object ID (始点オブジェクト)target: Codomain object ID (終点オブジェクト)morphism_type: Functional relation classification (Action,Cause,Relation)attributes/detail: Contextual bound conditions (When,Where,Why,How)
Explicit Particle References
Explicit particle IDs from upstream stages take precedence. When Stage 3 omits a cause_particle_id or effect_particle_id, the mapper can resolve its cause or effect text against an exact particle label (case-insensitive); duplicate labels are accepted only when stage1.agent and the particle's Agent: constraint identify one unique particle. Ambiguous labels and unknown or wrong-type explicit IDs produce no edge. Other edge endpoints are not inferred from array positions or constraint text.
Stage 3 structure may include agent_particle_id, cause_particle_id, effect_particle_id, context_particle_id, and event_particle_id as applicable. Stage 4/5 may include source_particle_id and target_particle_id. Particle-level constraints use target_particle_id or properties.event_particle_id.
Each reference must equal the target particle's existing id, for example:
{
"stage3": {
"structure": {
"cause": "you helped",
"effect": "I succeeded",
"cause_particle_id": "p_cause_123",
"effect_particle_id": "p_effect_456",
"agent_particle_id": "p_agent_789"
}
}
}Quick Start
1. Execution
Ingest particle.json (local or via automated fetch) and generate the topological graph network:
python -m src.main python visualize.py
2. Output Example (topological_graph.json)
{
"nodes": [
{
"id": "p_agent_6ed29f",
"label": "He",
"category": "Entity",
"resolution_state": "Determined",
"attributes": {
"who": "He",
"what": "Unspecified",
"when": "Unspecified",
"where": "Unspecified",
"why": "Unspecified",
"how": "Unspecified"
}
},
{
"id": "p_cause_5211ee",
"label": "the project",
"category": "Event",
"resolution_state": "Determined",
"attributes": {
"who": "Unspecified",
"what": "the project",
"when": "Unspecified",
"where": "Unspecified",
"why": "Unspecified",
"how": "Unspecified"
}
}
],
"edges": [
{
"id": "e_cause_p_cause_5211ee_p_effect_caf9ed",
"source": "p_cause_5211ee",
"target": "p_effect_caf9ed",
"morphism_type": "Cause",
"detail": "Primary Cause"
}
]
}Repository Structure
topological-mapping/
├── README.md # Project documentation
├── data/
│ ├── log.json # Input log data
│ └── particles.json # Ingested particle objects
├── topological_graph.json # Exported topological network graph
├── visualize.py
├── index.html
└── src/
├── main.py # Pipeline execution script
└── graph.py # Graph data structures and GraphBuilder logic
来源:GitHub · github.com

