https://github.com/blockscience/koi-net
Implementation of Knowledge Organization Infrastructure Network (KOI-net) protocol in Python
https://github.com/blockscience/koi-net
Last synced: about 2 months ago
JSON representation
Implementation of Knowledge Organization Infrastructure Network (KOI-net) protocol in Python
- Host: GitHub
- URL: https://github.com/blockscience/koi-net
- Owner: BlockScience
- License: mit
- Created: 2025-02-07T11:59:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-29T21:18:30.000Z (2 months ago)
- Last Synced: 2026-04-29T23:00:50.602Z (2 months ago)
- Language: Python
- Homepage:
- Size: 6.34 MB
- Stars: 16
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KOI-net
[](https://pypi.org/project/koi-net/)
[](https://blockscience.github.io/koi-net/index.html)
*This protocol and framework are the result of several iterations of KOI research, [read more here](https://github.com/BlockScience/koi).*
KOI-net (Knowledge Organization Infrastructure Network) can be understood as both a network protocol for distributed knowledge processing, and as a Python framework for building nodes, networks, and applications on top of that protocol. This repo is the implementation of that framework.
For information about the KOI-net protocol, see the [official specification](https://blockscience.github.io/koi-net-spec).
# Quick Start
## Installation
(Optionally) create and activate a virtual environment, and install KOI-net:
```shell
$ pip install koi-net
```
## Create a Simple Partial Node
The KOI-net framework is built around the [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) pattern. Node classes are *containers* for interdependent *components* implementing internal subsystems. Each node inherits from a base partial or full node class, which comes with ~36 default components. At a minimum, each node needs to implement a config component:
```python
from koi_net.config import PartialNodeConfig, KoiNetConfig, PartialNodeProfile
class MyPartialNodeConfig(PartialNodeConfig):
koi_net: KoiNetConfig = KoiNetConfig(
node_name="partial",
node_profile=PartialNodeProfile()
)
```
Which is set in the node container:
```python
from koi_net.core import PartialNode
class MyPartialNode(PartialNode):
config_schema = MyPartialNodeConfig
```
Finally, the main method can be set to build and run the node:
```python
if __name__ == "__main__":
MyPartialNode().run()
```
See `examples/coordinator.py` for a more complex example node, or see [the docs](https://blockscience.github.io/koi-net) for more information on the KOI-net framework.
This framework depends on [rid-lib](https://github.com/BlockScience/rid-lib), the Python implementation of the RID protocol.