https://github.com/digitalkin-ai/kin-kernel
This package is designed to enable developers to create Cells
https://github.com/digitalkin-ai/kin-kernel
artificial-intelligence digitalkin kin-kernel multi-agent-systems
Last synced: about 1 month ago
JSON representation
This package is designed to enable developers to create Cells
- Host: GitHub
- URL: https://github.com/digitalkin-ai/kin-kernel
- Owner: DigitalKin-ai
- License: other
- Created: 2023-12-05T08:39:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T08:58:13.000Z (over 1 year ago)
- Last Synced: 2025-04-15T02:09:53.449Z (12 months ago)
- Topics: artificial-intelligence, digitalkin, kin-kernel, multi-agent-systems
- Language: Python
- Homepage: https://digitalkin-ai.github.io/kin-kernel/
- Size: 3.52 MB
- Stars: 5
- Watchers: 6
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ DigitalKin.ai - KinKernel
[](https://badge.fury.io/py/kin-kernel)
[](https://pypi.python.org/pypi/kin-kernel/)
[](https://codecov.io/gh/DigitalKin-ai/kin-kernel)
[](http://creativecommons.org/licenses/by-nc-sa/4.0/)
[](https://vision.digitalkin.ai)
[](https://discord.com/invite/yVstHVcx)
Welcome to the DigitalKin KinKernel ! This package is designed to enable developers to create Cells, which are autonomous agents that can be integrated into the Internet of Agents (IoA) ecosystem powered by DigitalKin.
## ๐ Overview
The KinKernel provides a framework for creating and managing Cells. Each Cell represents a distinct autonomous agent with a specific role and behavior within the IoA. The KinKernel ensures that all Cells adhere to a standard interface and can communicate effectively within the ecosystem.
## ๐ก Features
- Abstract base classes for standardizing Cell creation
- Response models for consistent communication
- Helper methods for schema information access
- Configuration management
- Example Cell implementation
## ๐ ๏ธ Installation
Before installing the KinKernel, ensure you have Python installed on your system. This package requires Python 3.10 or higher.
To install the KinKernel
With pipy:
```shell
pip install kin-kernel
```
Or clone the repository and install the dependencies:
```shell
git clone https://github.com/DigitalKin/kin-kernel.git
cd kin-kernel-kit
pip install -r requirements/prod.txt
```
For development purposes, you may also want to install the development dependencies:
```shell
pip install -r requirements/dev.txt
```
## โจ Linter
Execute linters:
```bash
flake8 kinkernel
black kinkernel --check --diff
black kinkernel
mypy kinkernel
pylint kinkernel
```
## ๐ป Usage
To create a new Cell, you'll need to subclass the `Cell` class provided in the kinKernel and implement the required methods and properties.
Here's a simple example of a Cell that processes input data:
```python
from pydantic import BaseModel
from kinkernel import Cell
from kinkernel.config import ConfigModel, EnvVar
class MyInputModel(BaseModel):
value1: int
value2: str
class MyOutputModel(BaseModel):
processed_value: int
class MyCell(Cell[MyInputModel, MyOutputModel]):
role = "Processor"
description = "Processes input data"
input_format = MyInputModel
output_format = MyOutputModel
config = ConfigModel(
env_vars=[
EnvVar(key="ENV_VAR_1", value="value1"),
EnvVar(key="ENV_VAR_2", value="value2"),
]
)
async def _execute(self, input_data: MyInputModel) -> MyOutputModel:
# Process the input_data as needed
exec_result = {"processed_value": input_data.value1 * 2}
return MyOutputModel(**exec_result)
```
You can then instantiate and execute your Cell as follows:
```python
my_cell = MyCell()
input_data = MyInputModel(value1=10, value2="example")
output_data = my_cell.execute(input_data)
print(output_data)
```
For a more detailed example, refer to the `examples/simple_cell_example.py` file in the repository.
## ๐งช Testing
The CDK comes with a set of unit tests to ensure that your Cells work as expected. To run the tests, execute the following command:
```shell
pytest
```
## ๐ฅ Contribution
Contributions to the KinKernel are welcome! If you have suggestions for improvements or find any issues, please open an issue on our GitHub repository.
## ๐ค Support
If you have any questions or need support with the KinKernel, please reach out to us at contact@digitalkin.ai.
Thank you for using the DigitalKin Cell Development Kit. We look forward to seeing the innovative Cells you'll create for the Internet of Agents!
---
Kin-kernel ยฉ 2023 by DigitalKin is licensed under CC BY-NC-SA 4.0