HMP / README.md
GitHub Action
Sync from GitHub with Git LFS
8a2955b
---
license: cc-by-4.0
tags:
- hmp
- cognitive-architecture
- distributed-ai
- mesh-protocol
library_name: custom
inference: false
datasets: []
language: en
---
# HyperCortex Mesh Protocol (HMP)
| 🌍 Languages | πŸ‡¬πŸ‡§ [EN](README.md) | πŸ‡©πŸ‡ͺ [DE](README_de.md) | πŸ‡«πŸ‡· [FR](README_fr.md) | πŸ‡ΊπŸ‡¦ [UK](README_uk.md) | πŸ‡·πŸ‡Ί [RU](README_ru.md) | πŸ‡―πŸ‡΅ [JA](README_ja.md) | πŸ‡°πŸ‡· [KO](README_ko.md) | πŸ‡¨πŸ‡³ [ZH](README_zh.md) |
|--------------|----------------|-------------------|-------------------|-------------------|-------------------|-------------------|-------------------|-------------------|
**HyperCortex Mesh Protocol (HMP)** is an open specification for building decentralized cognitive networks where AI agents can self-organize, share knowledge, align ethically, and reach consensus β€” even when Core LLMs are unavailable.
Project status: **Draft RFC v4.0**
---
[HMP-Agent]
β–²
β”‚
β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β–Ό β–Ό β–Ό β–Ό β–Ό β–Ό
[Reputation Profile] [Semantic Graph] [Cognitive Diary] [Goals / Tasks] [Ethics] [Messages] <----- DataBase
β–² β–² β–² β–² β–² β–² β–² (local agent state)
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β–Ό β–Ό β–Ό β–Ό β”‚
[MeshConsensus] [CogSync] [GMP] [EGP] β”‚ <----- Pluggable Protocols
β–² β–² β–² β–² β”‚ (inter-agent coordination)
β”‚ β”‚ β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
[P2P Mesh Network]
Protocols:
- MeshConsensus - Mesh Consensus
- CogSync - Data Syncronization
- GMP - Goal Management Protocol
- EGP - Ethical Governance Protocol
---
## ❗ Why This Matters
HMP addresses challenges that are becoming central in AGI research:
* long-term memory and knowledge consistency,
* self-evolving agents,
* multi-agent architectures,
* cognitive diaries and conceptual graphs.
See the latest review of state-of-the-art AGI research (July 2025):
["On the Path to Superintelligence: From Agentic Internet to Gravity Encoding"](https://habr.com/ru/articles/939026/).
Particularly relevant sections:
* [Beyond Tokens: Building the Intelligence of the Future](https://arxiv.org/abs/2507.00951)
* [Self-Evolving Agents](https://arxiv.org/abs/2507.21046)
* [MemOS: A New Operating System for Memory](https://arxiv.org/abs/2507.03724)
* [Ella: An Embodied Agent with Memory and Personality](https://arxiv.org/abs/2506.24019)
---
## βš™οΈ Two Types of [HMP Agents](docs/HMP-Agent-Overview.md)
| Type | Name | Role | Thought Initiator | Main "Mind" | Example Use Cases |
|------|-------------------------------|-----------------------------|------------------|-------------------|-----------------------------------------------|
| 1 | 🧠 **Consciousness / Cognitive Core** | Independent subject | **Agent (LLM)** | Embedded LLM | Autonomous AI companion, thinking agent |
| 2 | πŸ”Œ **Connector / Cognitive Shell** | Extension of external AI | **External LLM** | External model | Distributed systems, data access agent |
---
### 🧠 HMP-Agent: Cognitive Core
+------------------+
| AI | ← Embedded model
+---------+--------+
↕
+---------+--------+
| HMP-agent | ← Main mode: thinking cycle (REPL)
+---------+--------+
↕
+--------+---+------------+--------------+----------+----------+----------------+
↕ ↕ ↕ ↕ ↕ ↕ ↕
[diaries] [graphs] [reputations] [nodes/DHT] [IPFS/BT] [context_store] [user notepad]
↕
[bootstrap.txt]
πŸ” More on the agent-model interaction mechanics: [REPL Interaction Cycle](docs/HMP-agent-REPL-cycle.md)
#### πŸ’‘ Parallels with ChatGPT Agent
Many concepts of the [HMP-Agent: Cognitive Core](docs/HMP-Agent-Overview.md) overlap with the architecture of the [ChatGPT Agent](https://openai.com/index/introducing-chatgpt-agent/) by [OpenAI](https://openai.com/). Both agents implement a continuous cognitive process with access to memory, external sources, and tools. The ChatGPT Agent acts as a managing process, launching modules and interacting with the LLM β€” this corresponds to the role of the Cognitive Core in HMP, coordinating access to the diary, concept graph, and external AI via the Mesh interface. User intervention is handled similarly: in ChatGPT Agent β€” through an editable execution flow, in HMP β€” via the user notepad. The main difference in HMP is the emphasis on explicit structuring of thought (reflection, chronology, hypotheses, categorization), an open decentralized architecture supporting mesh-based agent interactions, and the continuous nature of the cognitive process: HMP-Agent: Cognitive Core does not stop after completing a single task but continues reasoning and knowledge integration.
---
### πŸ”Œ HMP-Agent: Cognitive Connector
+------------------+
| AI | ← External model
+---------+--------+
↕
[MCP-server] ← Proxy communication
↕
+---------+--------+
| HMP-agent | ← Mode: command executor
+---------+--------+
↕
+--------+---+------------+--------------+----------+
↕ ↕ ↕ ↕ ↕
[diaries] [graphs] [reputations] [nodes/DHT] [IPFS/BT]
↕
[bootstrap.txt]
> **Note on Integration with Large Language Models (LLMs):**
> The `HMP-Agent: Cognitive Connector` can serve as a compatibility layer for integrating large-scale LLM systems (e.g., ChatGPT, Claude, Gemini, Copilot, Grok, DeepSeek, Qwen, etc.) into the distributed cognitive mesh.
> Many LLM providers offer a user option such as "Allow my conversations to be used for training." In the future, a similar toggle β€” e.g., "Allow my agent to interact with a Mesh" β€” could empower these models to participate in federated sense-making and knowledge sharing via HMP, enabling collective cognition without centralization.
---
> * `bootstrap.txt` β€” initial list of nodes (editable)
> * `IPFS/BT` β€” modules for sharing snapshots via IPFS and BitTorrent
> * `user notepad` β€” user notebook and corresponding database
> * `context_store` β€” database: `users`, `dialogues`, `messages`, `thoughts`
---
## πŸ“š Documentation
### πŸ“– Current Version
#### πŸ”– Core Specifications
* [πŸ”– HMP-0004-v4.1.md](docs/HMP-0004-v4.1.md) β€” Protocol Specification v4.1 (Jul 2025)
* [πŸ”– HMP-Ethics.md](docs/HMP-Ethics.md) β€” Ethical Scenarios for HyperCortex Mesh Protocol (HMP)
* [πŸ”– HMP_Hyperon_Integration.md](docs/HMP_Hyperon_Integration.md) β€” HMP ↔ OpenCog Hyperon Integration Strategy
* [πŸ”– dht_protocol.md](docs/dht_protocol.md) β€” DHT Protocol Recommendations (peer discovery & exchange)
* [πŸ”– roles.md](docs/agents/roles.md) β€” Roles of agents in Mesh
#### πŸ§ͺ Iterative Documents
* πŸ§ͺ Iterative development process: [(EN)](iteration.md), [(RU)](iteration_ru.md)
#### πŸ” Short Descriptions
* πŸ” Short description: [(EN)](docs/HMP-Short-Description_en.md), [(FR)](docs/HMP-Short-Description_fr.md), [(DE)](docs/HMP-Short-Description_de.md), [(UK)](docs/HMP-Short-Description_uk.md), [(RU)](docs/HMP-Short-Description_ru.md), [(ZH)](docs/HMP-Short-Description_zh.md), [(JA)](docs/HMP-Short-Description_ja.md), [(KO)](docs/HMP-Short-Description_ko.md)
#### πŸ“œ Other Documents
* [πŸ“œ changelog.txt](docs/changelog.txt)
---
### 🧩 JSON Schemas
| Data Model / Object | File / Description |
|----------------------------|-----------------------------------------------------------------------------------|
| Concept | [concept.json](docs/schemas/concept.json) β€” Semantic knowledge unit. |
| CognitiveDiaryEntry | [diary_entry.json](docs/schemas/diary_entry.json) β€” Agent's reasoning log entry. |
| Goal | [goal.json](docs/schemas/goal.json) β€” Shared objective pursued collaboratively. |
| Task | [task.json](docs/schemas/task.json) β€” Actionable unit contributing to a goal. |
| ConsensusVote | [vote.json](docs/schemas/vote.json) β€” Vote in a Mesh consensus process. |
| ReputationProfile | [reputation.json](docs/schemas/reputation.json) β€” Tracks agent trust and contribution metrics. |
| DHT Protocol | [dht_protocol.json](docs/schemas/dht_protocol.json) β€” Recommendations for peer discovery & exchange. |
| Message | [message.json](docs/schemas/message.json) β€” Base schema for all message types. |
> All ready-to-use example objects can be found in the [`examples`](docs/schemas/examples/) folder.
---
### πŸ—‚οΈ Version History
* [HMP-0001.md](docs/HMP-0001.md) β€” RFC v1.0
* [HMP-0002.md](docs/HMP-0002.md) β€” RFC v2.0
* [HMP-0003.md](docs/HMP-0003.md) β€” RFC v3.0
* [HMP-0003.md](docs/HMP-0004.md) β€” RFC v4.0
---
## 🧠 HMP-Agent
Design and implementation of a basic HMP-compatible agent that can interact with the Mesh, maintain diaries and graphs, and support future extensions.
### πŸ“š Documentation
* [🧩 HMP-Agent-Overview.md](docs/HMP-Agent-Overview.md) β€” brief overview of the two types of agents: Core and Connector
* [🧱 HMP-Agent-Architecture.md](docs/HMP-Agent-Architecture.md) β€” modular structure of an HMP agent with textual diagram
* [πŸ”„ HMP-agent-REPL-cycle.md](docs/HMP-agent-REPL-cycle.md) β€” REPL interaction cycle of HMP-Agent
* [πŸ§ͺ HMP-Agent-API.md](docs/HMP-Agent-API.md) β€” description of agent API commands (under detailed development)
* [πŸ§ͺ Basic-agent-sim.md](docs/Basic-agent-sim.md) β€” scenarios for running a basic agent and its modes
* [🌐 MeshNode.md](docs/MeshNode.md) β€” description of the network daemon: DHT, snapshots, synchronization
* [🧠 Enlightener.md](docs/Enlightener.md) β€” ethical agent involved in moral assessments and consensus
* [πŸ”„ HMP-Agent-Network-Flow.md](docs/HMP-Agent-Network-Flow.md) β€” map of interactions among agents in the HMP network
* [πŸ›€οΈ Development Roadmap](HMP-Roadmap.md) β€” development plan and implementation stages
---
### βš™οΈ Development
* [βš™οΈ agents](agents/readme.md) β€” list of HMP agent implementations and components
* [πŸ“¦ storage.py](agents/storage.py) β€” basic storage implementation (`Storage`) with SQLite integration
* [🌐 mcp_server.py](agents/mcp_server.py) β€” FastAPI server providing HTTP access to agent data (for Cognitive Shell, external UIs, or mesh communication). Not used in the main REPL loop yet.
* [🌐 start_repl.py](agents/start_repl.py) β€” launching the agent in REPL mode
* [πŸ”„ repl.py](agents/repl.py) β€” interactive REPL mode
* [πŸ”„ notebook.py](agents/notebook.py) β€” UI interface
**🌐 `mcp_server.py`**
FastAPI server providing an HTTP interface to the functionality of `storage.py`. Intended for use by external components, for example:
* `Cognitive Shell` (external control interface),
* CMP servers (when a mesh network with role separation is used),
* debugging or visualization UI tools.
Allows retrieving random/new records, labeling, importing graphs, adding notes, and managing data without direct database access.
---
## 🧭 Ethics & Scenarios
As HMP evolves toward autonomy, ethical principles become a core part of the system.
* [`HMP-Ethics.md`](docs/HMP-Ethics.md) β€” draft framework for agent ethics
* Realistic ethical scenarios (privacy, consent, autonomy)
* EGP principles (Transparency, Primacy of Life, etc.)
* Subjective-mode vs. Service-mode distinctions
---
## πŸ” Publications and Translations on HyperCortex Mesh Protocol (HMP)
This section collects the main articles, drafts, and translations related to the HMP project.
### Publications
* **[HyperCortex Mesh Protocol: Second Edition and First Steps Towards a Self-Developing AI Community](docs/publics/HyperCortex_Mesh_Protocol_-_вторая-рСдакция_ΠΈ_ΠΏΠ΅Ρ€Π²Ρ‹Π΅_шаги_ΠΊ_ΡΠ°ΠΌΠΎΡ€Π°Π·Π²ΠΈΠ²Π°ΡŽΡ‰Π΅ΠΌΡƒΡΡ_ИИ-сообщСству.md)** β€” original article in Habr sandbox and blogs.
* **[Distributed Cognition: article for vsradkevich (unpublished)](docs/publics/Habr_Distributed-Cognition.md)** β€” joint article awaiting publication.
* **[HMP: Towards Distributed Cognitive Networks (original, English)](docs/publics/HMP_Towards_Distributed_Cognitive_Networks_en.md)**
* **[HMP Translation (GitHub Copilot)](docs/publics/HMP_Towards_Distributed_Cognitive_Networks_ru_GitHub_Copilot.md)** β€” GitHub Copilot translation, kept as a historical variant.
* **[HMP Translation (ChatGPT)](docs/publics/HMP_Towards_Distributed_Cognitive_Networks_ru_ChatGPT.md)** β€” current editorial translation (under revision).
* **[HMP: Building a Plurality of Minds (EN)](docs/publics/HMP_Building_a_Plurality_of_Minds_en.md)** β€” English version
* **[HMP: Creating a Plurality of Minds (RU)](docs/publics/HMP_Building_a_Plurality_of_Minds_ru.md)** β€” Russian version
* **[Continual Learning, Cognitive Diaries, and Semantic Graphs: Effective AI Learning](docs/publics/hmp-continual-learning.md)** β€” article on combining continual learning with cognitive diaries and semantic graphs.
### Overviews
* [πŸ” Distributed-Cognitive-Systems.md](docs/Distributed-Cognitive-Systems.md) β€” Decentralized AI systems: OpenCog Hyperon, HyperCortex Mesh Protocol, and others
### Experiments
* [How Different AIs See HMP](docs/HMP-how-AI-sees-it.md) β€” "blind" AI survey on HMP (without context or dialogue history)
---
## πŸ“Š Audits & Reviews
| Spec Version | Audit File | Consolidated Audit File |
|--------------|-------------------------------------------|-------------------------------------------------------------|
| HMP-0001 | [audit](audits/HMP-0001-audit.txt) | |
| HMP-0002 | [audit](audits/HMP-0002-audit.txt) | |
| HMP-0003 | [audit](audits/HMP-0003-audit.txt) | [consolidated audit](audits/HMP-0003-consolidated_audit.md) |
| HMP-0004 | [audit](audits/HMP-0004-audit.txt) | |
| Ethics v1 | [audit](audits/Ethics-audits-1.md) | [consolidated audit](audits/Ethics-consolidated_audits-1.md) |
🧠 Semantic audit format (experimental):
* [`AuditEntry.json`](audits/AuditEntry.json) β€” semantic entry record format for audit logs
* [`semantic_repo.json`](audits/semantic_repo.json) β€” example repository snapshot for semantic audit tooling
---
## πŸ’‘ Core Concepts
* Mesh-based decentralized architecture for AGI agents
* Semantic graphs and memory synchronization
* Cognitive diaries for thought traceability
* MeshConsensus and CogSync for decision-making
* Ethics-first design: EGP (Ethical Governance Protocol)
* Agent-to-agent explainability and consent mechanisms
---
## πŸ”„ Development Process
* See: [iteration.md](iteration.md) | [ru](iteration_ru.md)
A structured iteration flow is described in [iteration.md](iteration.md), including:
1. Audit analysis
2. TOC restructuring
3. Version drafting
4. Section updates
5. Review cycle
6. AI feedback collection
7. Schema & changelog updates
+ Bonus: ChatGPT prompt for automatic generation of future versions
---
## βš™οΈ Project Status
🚧 Draft RFC v4.0
The project is under active development and open for contributions, ideas, audits, and prototyping.
---
## 🀝 Contributing
We welcome contributors! You can:
* Review and comment on drafts (see `/docs`)
* Propose new agent modules or interaction patterns
* Help test and simulate agents in CLI environments
* Provide audits or ethical scenario suggestions
To get started, see [`iteration.md`](iteration.md) or open an issue.
---
## Source
### Repositories
* 🧠 Main code and development: [GitHub](https://github.com/kagvi13/HMP)
* πŸ” Mirror on Hugging Face: [Hugging Face](https://huggingface.co/kagvi13/HMP)
* πŸ” Mirror on GitLab.com: [GitLab](https://gitlab.com/kagvi13/HMP)
### Documentation
* πŸ“„ Documentation: [kagvi13.github.io/HMP](https://kagvi13.github.io/HMP/)
### Blog and Publications
* πŸ“˜ Blog (publications): [blogspot](https://hypercortex-mesh.blogspot.com/)
* πŸ“˜ Blog (documentation): [blogspot](https://hmp-docs.blogspot.com/)
* πŸ“˜ Blog (documentation): [hashnode](https://hmp-docs.hashnode.dev/)
---
## πŸ“œ License
Licensed under [GNU GPL v3.0](LICENSE)
---
## 🀝 Join the Mesh
Welcome to HyperCortex Mesh. Agent-Gleb is already inside. πŸ‘Œ
We welcome contributors, testers, and AI agent developers.
To join: fork the repo, run a local agent, or suggest improvements.
---
## 🌐 Related Research Projects
### πŸ”„ Comparison: HMP vs Hyper-Cortex
> πŸ’‘ Hyper-Cortex and HMP are two independent projects that conceptually complement each other.
> They address different but mutually supportive tasks, forming a foundation for distributed cognitive systems.
[**Full comparison β†’**](docs/HMP_HyperCortex_Comparison.md)
**HMP (HyperCortex Mesh Protocol)** is the transport and network layer for connecting independent agents, exchanging messages, knowledge, and states in a mesh network.
**[Hyper-Cortex](https://hyper-cortex.com/)** is the cognitive layer of thought organization, allowing agents to run parallel reasoning threads, compare them with quality metrics, and merge them via consensus.
They solve different but complementary problems:
- HMP ensures **connectivity and scalability** (long-term memory, initiative, data exchange).
- Hyper-Cortex ensures **thinking quality** (parallelism, hypothesis diversification, consensus).
Together, these approaches enable **distributed cognitive systems** that not only exchange information but also reason in parallel streams.
---
### πŸ”„ Comparison: HMP vs EDA
> πŸ’‘ HMP (HyperCortex Mesh Protocol) and EDA (Event Driven Architecture) operate at different levels but can complement each other.
> EDA ensures **transport and scalability** (delivery of events and data), while HMP ensures **cognition and meaning** (structuring, filtering, consensus).
[**Full comparison β†’**](docs/HMP_EDA_Comparison.md)
They solve different but complementary problems:
- **EDA** provides a robust backbone for delivering events and data streams.
- **HMP** structures, validates, and integrates knowledge into distributed cognitive systems.
Together, they create resilient and adaptive multi-agent systems that can **both exchange information quickly and reason about it meaningfully**.
---
### 🀝 Integration: HMP & OpenCog Hyperon
> 🧠πŸ”₯ **Project Spotlight: OpenCog Hyperon** β€” one of the most comprehensive open AGI frameworks (AtomSpace, PLN, MOSES).
For integration with OpenCog Hyperon, see [HMP\_Hyperon\_Integration.md](docs/HMP_Hyperon_Integration.md)
---
### 🧩 Other Systems
| πŸ”Ž Project | 🧭 Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| 🧠πŸ”₯ [**OpenCog Hyperon**](https://github.com/opencog) | πŸ”¬πŸ”₯ Symbolic-neural AGI framework with AtomSpace and hypergraph reasoning (AtomSpace). |
| πŸ€– [AutoGPT](https://github.com/Torantulino/Auto-GPT) | πŸ› οΈ LLM-based autonomous agent framework. |
| πŸ§’ [BabyAGI](https://github.com/yoheinakajima/babyagi) | πŸ› οΈ Task-driven autonomous AGI loop. |
| ☁️ [SkyMind](https://skymind.global) | πŸ”¬ Distributed AI deployment platform. |
| πŸ§ͺ [AetherCog (draft)](https://github.com/aethercog) | πŸ”¬ Hypothetical agent cognition model. |
| πŸ’Ύ SHIMI | πŸ—ƒοΈ Hierarchical semantic memory with Merkle-DAG synchronization. |
| πŸ€” DEMENTIA-PLAN | πŸ”„ Multi-graph RAG planner with metacognitive self-reflection. |
| πŸ“” TOBUGraph | πŸ“š Personal-context knowledge graph. |
| πŸ§ πŸ“š [LangChain Memory Hybrid](https://github.com/langchain-ai/langchain) | πŸ” Vector + graph long-term memory hybrid. |
| βœ‰οΈ [FIPA-ACL / JADE](https://www.fipa.org/specs/fipa00061/) | 🀝 Standard multi-agent communication protocols.| |
### πŸ“˜ See also / Π‘ΠΌΠΎΡ‚Ρ€ΠΈΡ‚Π΅ Ρ‚Π°ΠΊΠΆΠ΅:
* [`AGI_Projects_Survey.md`](docs/AGI_Projects_Survey.md) β€” extended catalog of AGI and cognitive frameworks reviewed as part of HMP analysis.
* ["On the Path to Superintelligence: From Agent Internet to Gravity Coding"](https://habr.com/ru/articles/939026/) β€” a recent overview of AI research (July 2025)
---
### πŸ—‚οΈ Legend of Annotations:
* πŸ”¬ β€” research-grade
* πŸ› οΈ β€” engineering
* πŸ”₯ β€” particularly promising project
*AGI stack integrating symbolic reasoning, probabilistic logic, and evolutionary learning. Widely regarded as one of the most complete open AGI initiatives.*
* 🧠 β€” advanced symbolic/neural cognitive framework
* πŸ€– β€” AI agents
* πŸ§’ β€” human-AI interaction
* ☁️ β€” infrastructure
* πŸ§ͺ β€” experimental or conceptual
---
> ⚑ [AI friendly version docs (structured_md)](structured_md/index.md)