# KernelMind
> The minimalist thinking kernel for building LLM-powered AI agents.
**KernelMind** is a lightweight, flexible framework designed to build agentic LLM systems using a simple yet powerful abstraction: `Point` + `Line`.
It is ideal for rapidly prototyping workflows, agents, RAG pipelines, and structured thinking systems โ all in **under 100 lines of core code**.
---
## โจ Key Features
- ๐ง **Agentic-first architecture** โ Built from the ground up for multi-step reasoning
- ๐ **Point + Line abstraction** โ Minimal and composable flow control
- โ๏ธ **Retry / Fallback** โ Built-in error recovery mechanism
- ๐ **Sync & Async support** โ Automatically detects coroutine behavior
- ๐งช **Testable by design** โ Small units, observable memory store
- ๐ฟ **Extensible** โ Implement any agent/workflow pattern
---
## ๐ก Core Concepts
| Concept | Description |
|--------|-------------|
| `Point` | A minimal unit of logic (LLM or utility call) |
| `Line` | A composition of points connected via actions |
| `Memory` | A dictionary-style global store shared across points |
| `load()` / `process()` / `save()` | The 3 lifecycle steps of each Point |
```python
class Point:
def load(self, memory): ...
def process(self, item): ...
def save(self, memory, input, output): ...
```
---
## ๐ฆ Installation
### Option 1: Using uv (Recommended)
[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver, written in Rust.
#### 1. Install uv
```bash
# Using pipx (recommended)
pipx install uv
# Or using Homebrew (macOS)
brew install uv
# Or using curl
curl -LsSf https://astral.sh/uv/install.sh | sh
```
#### 2. Create virtual environment and install dependencies
```bash
# Clone the repository
git clone https://github.com/your-org/kernelmind-framework.git
cd kernelmind-framework
# Create virtual environment and install in development mode
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
# Or install specific dependencies
uv add requests
uv add --dev pytest
```
#### 3. Run the example
```bash
python examples/agent_qa.py
```
### Option 2: Using pip (Traditional)
```bash
# Install from PyPI (when published)
pip install kernelmind
# Or install in development mode
git clone https://github.com/your-org/kernelmind-framework.git
cd kernelmind-framework
pip install -e .
```
### Option 3: Manual Setup
```bash
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install -e .
```
---
## ๐ Quick Example: Q&A Agent
```python
from kernelmind.core import Point, Line
class GetQuestion(Point):
def load(self, memory):
return "start" # Return a non-None value to trigger process()
def process(self, _):
user_input = input("Ask: ")
return user_input
def save(self, memory, _, out):
memory["question"] = out;
return "default"
class AnswerQuestion(Point):
def load(self, memory):
return memory["question"]
def process(self, q):
return f"Answer: {q}"
def save(self, memory, _, out):
print("Answer:", out)
ask = GetQuestion()
answer = AnswerQuestion()
ask >> answer
qa_line = Line(entry=ask)
qa_line.run({})
```
---
## ๐ง Supported Design Patterns
- โ
Multi-step Workflow
- โ
Agent with Contextual Actions
- โ
RAG (Retrieval-Augmented Generation)
- โ
Map Reduce
- โ
Structured YAML Output
> See [docs/guide.md](./docs/guide.md) for examples and best practices.
---
## ๐ Project Structure
```
kernelmind/
โโโ core.py # Core logic: Point + Line
โโโ utils/ # External API wrappers (LLM, search, etc.)
โโโ examples/ # Use cases (Agent, RAG, Workflow)
โโโ tests/ # Unit tests
โโโ docs/guide.md # Developer documentation
```
---
## ๐ Documentation
Check out the full usage guide and design patterns in:
๐ [`docs/guide.md`](./docs/guide.md)
---
## ๐งช Run Tests
```bash
# Using uv
uv run pytest tests/
# Using pip
pytest tests/
```
---
## โค๏ธ Philosophy
> From Points to Minds. From Lines to Agents.
KernelMind is not just a framework.
It is a **philosophy of thinking through structure** โ building powerful systems with minimal building blocks.
---
## ๐ฌ Contribution
Pull requests welcome! If you have suggestions, open an issue or start a discussion.
MIT License ยท Built for the AI-native future.
Raw data
{
"_id": null,
"home_page": "https://github.com/zhanj/kernelmind-framework",
"name": "kernelmind",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ai, agents, llm, workflow, framework",
"author": "Ethan Zhan",
"author_email": "Ethan Zhan <jiezhan1@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/25/91/7118f670689e415f4aee05be0ce1f749a336eea7b0581c0bcd58b5f08035/kernelmind-0.1.1.tar.gz",
"platform": null,
"description": "# KernelMind\n\n> The minimalist thinking kernel for building LLM-powered AI agents.\n\n**KernelMind** is a lightweight, flexible framework designed to build agentic LLM systems using a simple yet powerful abstraction: `Point` + `Line`. \nIt is ideal for rapidly prototyping workflows, agents, RAG pipelines, and structured thinking systems \u2014 all in **under 100 lines of core code**.\n\n---\n\n## \u2728 Key Features\n\n- \ud83e\udde0 **Agentic-first architecture** \u2013 Built from the ground up for multi-step reasoning\n- \ud83d\udd01 **Point + Line abstraction** \u2013 Minimal and composable flow control\n- \u2699\ufe0f **Retry / Fallback** \u2013 Built-in error recovery mechanism\n- \ud83d\ude80 **Sync & Async support** \u2013 Automatically detects coroutine behavior\n- \ud83e\uddea **Testable by design** \u2013 Small units, observable memory store\n- \ud83c\udf3f **Extensible** \u2013 Implement any agent/workflow pattern\n\n---\n\n## \ud83d\udca1 Core Concepts\n\n| Concept | Description |\n|--------|-------------|\n| `Point` | A minimal unit of logic (LLM or utility call) |\n| `Line` | A composition of points connected via actions |\n| `Memory` | A dictionary-style global store shared across points |\n| `load()` / `process()` / `save()` | The 3 lifecycle steps of each Point |\n\n```python\nclass Point:\n def load(self, memory): ...\n def process(self, item): ...\n def save(self, memory, input, output): ...\n```\n\n---\n\n## \ud83d\udce6 Installation\n\n### Option 1: Using uv (Recommended)\n\n[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver, written in Rust.\n\n#### 1. Install uv\n\n```bash\n# Using pipx (recommended)\npipx install uv\n\n# Or using Homebrew (macOS)\nbrew install uv\n\n# Or using curl\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n#### 2. Create virtual environment and install dependencies\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-org/kernelmind-framework.git\ncd kernelmind-framework\n\n# Create virtual environment and install in development mode\nuv venv\nsource .venv/bin/activate # On Windows: .venv\\Scripts\\activate\nuv pip install -e .\n\n# Or install specific dependencies\nuv add requests\nuv add --dev pytest\n```\n\n#### 3. Run the example\n\n```bash\npython examples/agent_qa.py\n```\n\n### Option 2: Using pip (Traditional)\n\n```bash\n# Install from PyPI (when published)\npip install kernelmind\n\n# Or install in development mode\ngit clone https://github.com/your-org/kernelmind-framework.git\ncd kernelmind-framework\npip install -e .\n```\n\n### Option 3: Manual Setup\n\n```bash\n# Create virtual environment\npython3 -m venv venv\nsource venv/bin/activate # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\npip install -e .\n```\n\n---\n\n## \ud83d\ude80 Quick Example: Q&A Agent\n\n```python\nfrom kernelmind.core import Point, Line\n\nclass GetQuestion(Point):\n def load(self, memory):\n return \"start\" # Return a non-None value to trigger process()\n \n def process(self, _): \n user_input = input(\"Ask: \")\n return user_input\n \n def save(self, memory, _, out): \n memory[\"question\"] = out; \n return \"default\"\n\nclass AnswerQuestion(Point):\n def load(self, memory): \n return memory[\"question\"]\n \n def process(self, q): \n return f\"Answer: {q}\"\n \n def save(self, memory, _, out): \n print(\"Answer:\", out)\n\nask = GetQuestion()\nanswer = AnswerQuestion()\nask >> answer\nqa_line = Line(entry=ask)\nqa_line.run({})\n```\n\n---\n\n## \ud83e\udde0 Supported Design Patterns\n\n- \u2705 Multi-step Workflow\n- \u2705 Agent with Contextual Actions\n- \u2705 RAG (Retrieval-Augmented Generation)\n- \u2705 Map Reduce\n- \u2705 Structured YAML Output\n\n> See [docs/guide.md](./docs/guide.md) for examples and best practices.\n\n---\n\n## \ud83d\udcc1 Project Structure\n\n```\nkernelmind/\n\u251c\u2500\u2500 core.py # Core logic: Point + Line\n\u251c\u2500\u2500 utils/ # External API wrappers (LLM, search, etc.)\n\u251c\u2500\u2500 examples/ # Use cases (Agent, RAG, Workflow)\n\u251c\u2500\u2500 tests/ # Unit tests\n\u251c\u2500\u2500 docs/guide.md # Developer documentation\n```\n\n---\n\n## \ud83d\udcd6 Documentation\n\nCheck out the full usage guide and design patterns in:\n\n\ud83d\udcda [`docs/guide.md`](./docs/guide.md)\n\n---\n\n## \ud83e\uddea Run Tests\n\n```bash\n# Using uv\nuv run pytest tests/\n\n# Using pip\npytest tests/\n```\n\n---\n\n## \u2764\ufe0f Philosophy\n\n> From Points to Minds. From Lines to Agents.\n\nKernelMind is not just a framework. \nIt is a **philosophy of thinking through structure** \u2014 building powerful systems with minimal building blocks.\n\n---\n\n## \ud83d\udcec Contribution\n\nPull requests welcome! If you have suggestions, open an issue or start a discussion.\n\nMIT License \u00b7 Built for the AI-native future.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A minimalist thinking kernel for LLM agents",
"version": "0.1.1",
"project_urls": {
"Documentation": "https://github.com/zhanj/kernelmind-framework#readme",
"Homepage": "https://github.com/zhanj/kernelmind-framework",
"Issues": "https://github.com/zhanj/kernelmind-framework/issues",
"Repository": "https://github.com/zhanj/kernelmind-framework"
},
"split_keywords": [
"ai",
" agents",
" llm",
" workflow",
" framework"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "07c5ab8a015cc1bee2ca0f7eb55b34df0b867aa756e0efd0bd2bd44ce12fad80",
"md5": "14b83fd01f3baf42ddd9b29b30eba017",
"sha256": "2a58e3eefc6c3e0e6e040c0e725ddb763cf88483a8a5fc7ab531a3e1f5cfcd53"
},
"downloads": -1,
"filename": "kernelmind-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "14b83fd01f3baf42ddd9b29b30eba017",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5414,
"upload_time": "2025-08-03T03:20:37",
"upload_time_iso_8601": "2025-08-03T03:20:37.469543Z",
"url": "https://files.pythonhosted.org/packages/07/c5/ab8a015cc1bee2ca0f7eb55b34df0b867aa756e0efd0bd2bd44ce12fad80/kernelmind-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "25917118f670689e415f4aee05be0ce1f749a336eea7b0581c0bcd58b5f08035",
"md5": "af892b18623f56944ea985eefda10ed2",
"sha256": "918d1ea55a642db759049b03326c09644825385ee769e57a0648e6322f241e4f"
},
"downloads": -1,
"filename": "kernelmind-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "af892b18623f56944ea985eefda10ed2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9009,
"upload_time": "2025-08-03T03:20:39",
"upload_time_iso_8601": "2025-08-03T03:20:39.080065Z",
"url": "https://files.pythonhosted.org/packages/25/91/7118f670689e415f4aee05be0ce1f749a336eea7b0581c0bcd58b5f08035/kernelmind-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-03 03:20:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zhanj",
"github_project": "kernelmind-framework",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "openai",
"specs": []
},
{
"name": "pyyaml",
"specs": []
},
{
"name": "numpy",
"specs": []
}
],
"lcname": "kernelmind"
}