This protocol and framework are the result of several iterations of KOI research, read more here.
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.
(Optionally) create and activate a virtual environment, and install KOI-net:
$ pip install koi-netThe KOI-net framework is built around the 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:
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:
from koi_net.core import PartialNode
class MyPartialNode(PartialNode):
config_schema = MyPartialNodeConfigFinally, the main method can be set to build and run the node:
if __name__ == "__main__":
MyPartialNode().run()See examples/coordinator.py for a more complex example node, or see the docs for more information on the KOI-net framework.
This framework depends on rid-lib, the Python implementation of the RID protocol.
This project uses Sphinx to generate documentation from docstrings. The docs.yml GitHub workflow automatically build and deploys the docs to GitHub Pages. To build the docs locally, run the following command:
$ uv run --extra docs sphinx-build -b html docs docs/_build/html