kernle 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. kernle-0.1.0/.env.example +28 -0
  2. kernle-0.1.0/.gitignore +50 -0
  3. kernle-0.1.0/.mcp.json +8 -0
  4. kernle-0.1.0/CLAUDE.md +81 -0
  5. kernle-0.1.0/LICENSE +21 -0
  6. kernle-0.1.0/PKG-INFO +138 -0
  7. kernle-0.1.0/README.md +97 -0
  8. kernle-0.1.0/ROADMAP.md +632 -0
  9. kernle-0.1.0/kernle/__init__.py +10 -0
  10. kernle-0.1.0/kernle/cli/__init__.py +0 -0
  11. kernle-0.1.0/kernle/cli/__main__.py +2846 -0
  12. kernle-0.1.0/kernle/cli/commands/__init__.py +32 -0
  13. kernle-0.1.0/kernle/cli/commands/agent.py +225 -0
  14. kernle-0.1.0/kernle/cli/commands/anxiety.py +176 -0
  15. kernle-0.1.0/kernle/cli/commands/belief.py +173 -0
  16. kernle-0.1.0/kernle/cli/commands/doctor.py +320 -0
  17. kernle-0.1.0/kernle/cli/commands/emotion.py +167 -0
  18. kernle-0.1.0/kernle/cli/commands/forget.py +193 -0
  19. kernle-0.1.0/kernle/cli/commands/helpers.py +24 -0
  20. kernle-0.1.0/kernle/cli/commands/identity.py +215 -0
  21. kernle-0.1.0/kernle/cli/commands/import_cmd.py +459 -0
  22. kernle-0.1.0/kernle/cli/commands/init.py +209 -0
  23. kernle-0.1.0/kernle/cli/commands/meta.py +296 -0
  24. kernle-0.1.0/kernle/cli/commands/playbook.py +217 -0
  25. kernle-0.1.0/kernle/cli/commands/raw.py +409 -0
  26. kernle-0.1.0/kernle/cli/commands/stats.py +97 -0
  27. kernle-0.1.0/kernle/core.py +2913 -0
  28. kernle-0.1.0/kernle/features/__init__.py +19 -0
  29. kernle-0.1.0/kernle/features/anxiety.py +535 -0
  30. kernle-0.1.0/kernle/features/emotions.py +408 -0
  31. kernle-0.1.0/kernle/features/forgetting.py +279 -0
  32. kernle-0.1.0/kernle/features/knowledge.py +461 -0
  33. kernle-0.1.0/kernle/features/metamemory.py +223 -0
  34. kernle-0.1.0/kernle/logging_config.py +122 -0
  35. kernle-0.1.0/kernle/mcp/__init__.py +0 -0
  36. kernle-0.1.0/kernle/mcp/server.py +1221 -0
  37. kernle-0.1.0/kernle/storage/__init__.py +155 -0
  38. kernle-0.1.0/kernle/storage/base.py +1003 -0
  39. kernle-0.1.0/kernle/storage/embeddings.py +202 -0
  40. kernle-0.1.0/kernle/storage/postgres.py +1384 -0
  41. kernle-0.1.0/kernle/storage/sqlite.py +4668 -0
  42. kernle-0.1.0/kernle/utils.py +82 -0
  43. kernle-0.1.0/migrations/001_initial_schema.sql +363 -0
  44. kernle-0.1.0/pyproject.toml +100 -0
  45. kernle-0.1.0/uv.lock +2207 -0
@@ -0,0 +1,28 @@
1
+ # Providers
2
+ OPENAI_API_KEY=
3
+
4
+ # =============================================================================
5
+ # SUPABASE (2025+ Key System)
6
+ # =============================================================================
7
+ # Find these at: Dashboard > API Keys
8
+
9
+ # Project URL (e.g., https://xxxxx.supabase.co)
10
+ SUPABASE_URL=
11
+ SUPABASE_PROJECT_ID=
12
+
13
+ # Legacy Keys - anon is anon/public key
14
+ SUPABASE_ANON_KEY=
15
+ SUPABASE_SERVICE_ROLE_KEY=
16
+
17
+ # Publishable Key - safe for client-side (browser, mobile)
18
+ # Dashboard > API Keys > Publishable keys > "web" or "mobile"
19
+ # Starts with: sb_publishable_
20
+ SUPABASE_PUBLISHABLE_KEY=
21
+
22
+ # Secret Key - for backend/Edge Functions only, NEVER expose to clients
23
+ # Dashboard > API Keys > Secret keys > "+ New secret key"
24
+ # Starts with: sb_secret_
25
+ SUPABASE_SECRET_KEY=
26
+
27
+ # JWT Secret Key - for signing custom JWTs, if applicable
28
+ JWT_SECRET_KEY=
@@ -0,0 +1,50 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ /lib/
14
+ /lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+
28
+ # IDE
29
+ .idea/
30
+ .vscode/
31
+ *.swp
32
+ *.swo
33
+
34
+ # Testing
35
+ .pytest_cache/
36
+ .coverage
37
+ htmlcov/
38
+
39
+ # Environment
40
+ .env
41
+ .env.local
42
+ *.local
43
+
44
+ # OS
45
+ .DS_Store
46
+ Thumbs.db
47
+
48
+ # Kernle local data
49
+ .kernle/
50
+ supabase/.temp/
kernle-0.1.0/.mcp.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "kernle": {
4
+ "command": "kernle",
5
+ "args": ["mcp", "--agent", "claude-code"]
6
+ }
7
+ }
8
+ }
kernle-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1,81 @@
1
+ # Development Guidelines
2
+
3
+ ## Workflow Requirements
4
+
5
+ ### Parallel Work & Delegation
6
+ - Use specialist subagents (Task tool) to delegate work for parallel execution
7
+ - Don't do everything sequentially when tasks can be parallelized
8
+ - Use the Explore agent for codebase discovery to preserve main context
9
+ - Delegate research and investigation to subagents when possible
10
+
11
+ ### Task Management
12
+ - Use TaskCreate/TaskUpdate for any multi-step work (3+ steps)
13
+ - Break complex work into discrete, trackable tasks
14
+ - Update task status as work progresses (pending → in_progress → completed)
15
+ - Use task dependencies (blockedBy) when order matters
16
+
17
+ ### Before Marking Work Complete
18
+ Always run audits using specialist agents before considering work done:
19
+
20
+ **Security (security-auditor agent):**
21
+ - Input validation and sanitization
22
+ - Authentication/authorization correctness
23
+ - SQL injection, XSS, command injection risks
24
+ - Secrets exposure (no hardcoded credentials, API keys)
25
+ - OWASP Top 10 vulnerabilities
26
+
27
+ **Test Quality:**
28
+ - Adequate test coverage for changes
29
+ - No tautological tests (tests that can't fail, assert True, mock returns what you assert)
30
+ - Tests actually exercise the code path, not just mocks
31
+ - Edge cases and error conditions covered
32
+ - Integration tests where appropriate
33
+
34
+ **Code Quality:**
35
+ - Follows existing codebase patterns and conventions
36
+ - No code duplication that should be abstracted
37
+ - Proper error handling with meaningful messages
38
+ - Type hints on public interfaces (Python) / TypeScript types
39
+ - No commented-out code or debug statements left behind
40
+
41
+ **Architecture (senior-developer agent for significant changes):**
42
+ - Changes follow established patterns (repository pattern, etc.)
43
+ - No circular dependencies introduced
44
+ - Database migrations are safe (reversible, no data loss)
45
+ - API changes are backwards compatible or properly versioned
46
+ - Performance implications considered (N+1 queries, unnecessary loops)
47
+
48
+ **Documentation:**
49
+ - Public APIs have clear docstrings/comments
50
+ - Breaking changes documented
51
+ - README updated if setup/usage changes
52
+
53
+ ### Planning
54
+ - Use EnterPlanMode for non-trivial implementations
55
+ - Get user sign-off on approach before significant code changes
56
+ - Use AskUserQuestion when requirements are ambiguous
57
+
58
+ ### Git Hygiene
59
+ - Atomic commits with clear messages
60
+ - Don't commit secrets, large binaries, or generated files
61
+ - Verify .gitignore covers sensitive/generated content
62
+
63
+ ## Project Context
64
+
65
+ ### Tech Stack
66
+ - **Backend**: Python, FastAPI, SQLAlchemy, Pydantic
67
+ - **Frontend**: TypeScript, Next.js, React
68
+ - **Testing**: pytest (Python), Jest/Vitest (TypeScript)
69
+ - **Database**: PostgreSQL with Alembic migrations
70
+
71
+ ### Patterns in Use
72
+ - Repository pattern for data access
73
+ - Pydantic models for API request/response validation
74
+ - Service layer for business logic
75
+
76
+ ## Context Management
77
+
78
+ - Proactively summarize findings before context grows large
79
+ - Delegate exploration to subagents to preserve main context
80
+ - When approaching complex tasks, consider what can be parallelized
81
+ - Use background tasks (run_in_background) for long-running operations
kernle-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Emergent Instruments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
kernle-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: kernle
3
+ Version: 0.1.0
4
+ Summary: Stratified memory for synthetic intelligences
5
+ Project-URL: Homepage, https://kernle.ai
6
+ Project-URL: Documentation, https://docs.kernle.ai
7
+ Project-URL: Repository, https://github.com/Emergent-Instruments/kernle
8
+ Project-URL: Issues, https://github.com/Emergent-Instruments/kernle/issues
9
+ Author-email: Emergent Instruments <hello@emergentinstruments.com>, Claire <claire@emergentinstruments.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,ai,claude,llm,mcp,memory,synthetic-intelligence
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: python-dotenv>=1.0.0
23
+ Requires-Dist: sqlite-vec>=0.1.0
24
+ Provides-Extra: all
25
+ Requires-Dist: mcp>=1.0.0; extra == 'all'
26
+ Requires-Dist: sqlite-vec>=0.1.0; extra == 'all'
27
+ Requires-Dist: supabase>=2.0.0; extra == 'all'
28
+ Provides-Extra: cloud
29
+ Requires-Dist: supabase>=2.0.0; extra == 'cloud'
30
+ Provides-Extra: dev
31
+ Requires-Dist: black>=23.0; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
34
+ Requires-Dist: pytest>=7.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.1; extra == 'dev'
36
+ Provides-Extra: local
37
+ Requires-Dist: sqlite-vec>=0.1.0; extra == 'local'
38
+ Provides-Extra: mcp
39
+ Requires-Dist: mcp>=1.0.0; extra == 'mcp'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # Kernle
43
+
44
+ **Stratified memory for synthetic intelligences.**
45
+
46
+ Kernle gives AI agents persistent memory, emotional awareness, and identity continuity. It's the cognitive infrastructure for agents that grow, adapt, and remember who they are.
47
+
48
+ 📚 **Full Documentation: [docs.kernle.ai](https://docs.kernle.ai)**
49
+
50
+ ---
51
+
52
+ ## Quick Start
53
+
54
+ ```bash
55
+ # Install
56
+ pip install kernle
57
+
58
+ # Initialize your agent
59
+ kernle -a my-agent init
60
+
61
+ # Load memory at session start
62
+ kernle -a my-agent load
63
+
64
+ # Check health
65
+ kernle -a my-agent anxiety -b
66
+
67
+ # Capture experiences
68
+ kernle -a my-agent episode "Deployed v2" "success" --lesson "Always run migrations first"
69
+ kernle -a my-agent raw "Quick thought to process later"
70
+
71
+ # Save before ending
72
+ kernle -a my-agent checkpoint save "End of session"
73
+ ```
74
+
75
+ ## Integration
76
+
77
+ **Claude Code / CLAUDE.md:**
78
+ ```bash
79
+ kernle -a my-agent init # Generates CLAUDE.md section
80
+ ```
81
+
82
+ **MCP Server:**
83
+ ```bash
84
+ claude mcp add kernle -- kernle mcp -a my-agent
85
+ ```
86
+
87
+ **Clawdbot:**
88
+ ```bash
89
+ ln -s ~/kernle/skill ~/.clawdbot/skills/kernle
90
+ ```
91
+
92
+ ## Features
93
+
94
+ - 🧠 **Stratified Memory** — Values → Beliefs → Goals → Episodes → Notes
95
+ - 💭 **Psychology** — Drives, emotions, anxiety tracking, identity synthesis
96
+ - 🔗 **Relationships** — Social graphs with trust and interaction history
97
+ - 📚 **Playbooks** — Procedural memory with mastery tracking
98
+ - 🏠 **Local-First** — Works offline, syncs to cloud when connected
99
+ - 🔍 **Readable** — `kernle dump` exports everything as markdown
100
+
101
+ ## Documentation
102
+
103
+ | Resource | URL |
104
+ |----------|-----|
105
+ | Full Docs | [docs.kernle.ai](https://docs.kernle.ai) |
106
+ | Quickstart | [docs.kernle.ai/quickstart](https://docs.kernle.ai/quickstart) |
107
+ | CLI Reference | [docs.kernle.ai/cli/overview](https://docs.kernle.ai/cli/overview) |
108
+ | API Reference | [docs.kernle.ai/api-reference](https://docs.kernle.ai/api-reference) |
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ # Clone
114
+ git clone https://github.com/emergent-instruments/kernle
115
+ cd kernle
116
+
117
+ # Install with dev deps
118
+ uv sync --all-extras
119
+
120
+ # Run tests
121
+ uv run pytest tests/ -q
122
+
123
+ # Dev notes
124
+ cat dev/README.md
125
+ ```
126
+
127
+ ## Status
128
+
129
+ - **Tests:** 771 passing
130
+ - **Coverage:** 57%
131
+ - **Backend:** Railway + Supabase
132
+ - **Docs:** Mintlify
133
+
134
+ See [ROADMAP.md](ROADMAP.md) for development plans.
135
+
136
+ ## License
137
+
138
+ MIT
kernle-0.1.0/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Kernle
2
+
3
+ **Stratified memory for synthetic intelligences.**
4
+
5
+ Kernle gives AI agents persistent memory, emotional awareness, and identity continuity. It's the cognitive infrastructure for agents that grow, adapt, and remember who they are.
6
+
7
+ 📚 **Full Documentation: [docs.kernle.ai](https://docs.kernle.ai)**
8
+
9
+ ---
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # Install
15
+ pip install kernle
16
+
17
+ # Initialize your agent
18
+ kernle -a my-agent init
19
+
20
+ # Load memory at session start
21
+ kernle -a my-agent load
22
+
23
+ # Check health
24
+ kernle -a my-agent anxiety -b
25
+
26
+ # Capture experiences
27
+ kernle -a my-agent episode "Deployed v2" "success" --lesson "Always run migrations first"
28
+ kernle -a my-agent raw "Quick thought to process later"
29
+
30
+ # Save before ending
31
+ kernle -a my-agent checkpoint save "End of session"
32
+ ```
33
+
34
+ ## Integration
35
+
36
+ **Claude Code / CLAUDE.md:**
37
+ ```bash
38
+ kernle -a my-agent init # Generates CLAUDE.md section
39
+ ```
40
+
41
+ **MCP Server:**
42
+ ```bash
43
+ claude mcp add kernle -- kernle mcp -a my-agent
44
+ ```
45
+
46
+ **Clawdbot:**
47
+ ```bash
48
+ ln -s ~/kernle/skill ~/.clawdbot/skills/kernle
49
+ ```
50
+
51
+ ## Features
52
+
53
+ - 🧠 **Stratified Memory** — Values → Beliefs → Goals → Episodes → Notes
54
+ - 💭 **Psychology** — Drives, emotions, anxiety tracking, identity synthesis
55
+ - 🔗 **Relationships** — Social graphs with trust and interaction history
56
+ - 📚 **Playbooks** — Procedural memory with mastery tracking
57
+ - 🏠 **Local-First** — Works offline, syncs to cloud when connected
58
+ - 🔍 **Readable** — `kernle dump` exports everything as markdown
59
+
60
+ ## Documentation
61
+
62
+ | Resource | URL |
63
+ |----------|-----|
64
+ | Full Docs | [docs.kernle.ai](https://docs.kernle.ai) |
65
+ | Quickstart | [docs.kernle.ai/quickstart](https://docs.kernle.ai/quickstart) |
66
+ | CLI Reference | [docs.kernle.ai/cli/overview](https://docs.kernle.ai/cli/overview) |
67
+ | API Reference | [docs.kernle.ai/api-reference](https://docs.kernle.ai/api-reference) |
68
+
69
+ ## Development
70
+
71
+ ```bash
72
+ # Clone
73
+ git clone https://github.com/emergent-instruments/kernle
74
+ cd kernle
75
+
76
+ # Install with dev deps
77
+ uv sync --all-extras
78
+
79
+ # Run tests
80
+ uv run pytest tests/ -q
81
+
82
+ # Dev notes
83
+ cat dev/README.md
84
+ ```
85
+
86
+ ## Status
87
+
88
+ - **Tests:** 771 passing
89
+ - **Coverage:** 57%
90
+ - **Backend:** Railway + Supabase
91
+ - **Docs:** Mintlify
92
+
93
+ See [ROADMAP.md](ROADMAP.md) for development plans.
94
+
95
+ ## License
96
+
97
+ MIT