caudate-cli 0.1.84__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 (185) hide show
  1. caudate_cli-0.1.84/LICENSE +21 -0
  2. caudate_cli-0.1.84/PKG-INFO +384 -0
  3. caudate_cli-0.1.84/README.md +334 -0
  4. caudate_cli-0.1.84/api/__init__.py +5 -0
  5. caudate_cli-0.1.84/api/anthropic_compat.py +1518 -0
  6. caudate_cli-0.1.84/api/artifact_viewer.py +366 -0
  7. caudate_cli-0.1.84/api/caudate_middleware.py +618 -0
  8. caudate_cli-0.1.84/api/forge_bootstrapper_routes.py +377 -0
  9. caudate_cli-0.1.84/api/forge_routes.py +630 -0
  10. caudate_cli-0.1.84/api/forge_system_routes.py +294 -0
  11. caudate_cli-0.1.84/api/openai_compat.py +1993 -0
  12. caudate_cli-0.1.84/api/server.py +667 -0
  13. caudate_cli-0.1.84/api/storyboard_page.py +677 -0
  14. caudate_cli-0.1.84/caudate_cli.egg-info/PKG-INFO +384 -0
  15. caudate_cli-0.1.84/caudate_cli.egg-info/SOURCES.txt +183 -0
  16. caudate_cli-0.1.84/caudate_cli.egg-info/dependency_links.txt +1 -0
  17. caudate_cli-0.1.84/caudate_cli.egg-info/entry_points.txt +2 -0
  18. caudate_cli-0.1.84/caudate_cli.egg-info/requires.txt +30 -0
  19. caudate_cli-0.1.84/caudate_cli.egg-info/top_level.txt +14 -0
  20. caudate_cli-0.1.84/cognos_mcp/__init__.py +4 -0
  21. caudate_cli-0.1.84/cognos_mcp/bridge.py +41 -0
  22. caudate_cli-0.1.84/cognos_mcp/client.py +70 -0
  23. caudate_cli-0.1.84/cognos_mcp/config.py +49 -0
  24. caudate_cli-0.1.84/cognos_mcp/server.py +66 -0
  25. caudate_cli-0.1.84/config.py +82 -0
  26. caudate_cli-0.1.84/core/__init__.py +0 -0
  27. caudate_cli-0.1.84/core/agent.py +496 -0
  28. caudate_cli-0.1.84/core/agentic_loop.py +783 -0
  29. caudate_cli-0.1.84/core/anthropic_auth.py +91 -0
  30. caudate_cli-0.1.84/core/auto_onboarding.py +184 -0
  31. caudate_cli-0.1.84/core/background.py +113 -0
  32. caudate_cli-0.1.84/core/banner.py +138 -0
  33. caudate_cli-0.1.84/core/bootstrap.py +385 -0
  34. caudate_cli-0.1.84/core/citations.py +131 -0
  35. caudate_cli-0.1.84/core/compaction.py +109 -0
  36. caudate_cli-0.1.84/core/constitution.py +198 -0
  37. caudate_cli-0.1.84/core/custom_commands.py +149 -0
  38. caudate_cli-0.1.84/core/diff_viewer.py +87 -0
  39. caudate_cli-0.1.84/core/export.py +85 -0
  40. caudate_cli-0.1.84/core/file_refs.py +119 -0
  41. caudate_cli-0.1.84/core/files.py +199 -0
  42. caudate_cli-0.1.84/core/hooks.py +209 -0
  43. caudate_cli-0.1.84/core/image.py +599 -0
  44. caudate_cli-0.1.84/core/input.py +584 -0
  45. caudate_cli-0.1.84/core/loop.py +238 -0
  46. caudate_cli-0.1.84/core/memory_md.py +147 -0
  47. caudate_cli-0.1.84/core/notifications.py +99 -0
  48. caudate_cli-0.1.84/core/ownership.py +181 -0
  49. caudate_cli-0.1.84/core/paste.py +81 -0
  50. caudate_cli-0.1.84/core/permissions.py +916 -0
  51. caudate_cli-0.1.84/core/permissions_auto.py +183 -0
  52. caudate_cli-0.1.84/core/plan_mode.py +215 -0
  53. caudate_cli-0.1.84/core/sandbox_prompt.py +367 -0
  54. caudate_cli-0.1.84/core/scheduler.py +195 -0
  55. caudate_cli-0.1.84/core/schemas.py +202 -0
  56. caudate_cli-0.1.84/core/session.py +90 -0
  57. caudate_cli-0.1.84/core/settings.py +170 -0
  58. caudate_cli-0.1.84/core/skills.py +398 -0
  59. caudate_cli-0.1.84/core/slash_commands.py +1896 -0
  60. caudate_cli-0.1.84/core/statusline.py +79 -0
  61. caudate_cli-0.1.84/core/subagent.py +300 -0
  62. caudate_cli-0.1.84/core/thinking.py +50 -0
  63. caudate_cli-0.1.84/core/updater.py +122 -0
  64. caudate_cli-0.1.84/core/usage.py +109 -0
  65. caudate_cli-0.1.84/core/worktree.py +93 -0
  66. caudate_cli-0.1.84/execution/__init__.py +0 -0
  67. caudate_cli-0.1.84/execution/executor.py +331 -0
  68. caudate_cli-0.1.84/execution/plugins.py +108 -0
  69. caudate_cli-0.1.84/execution/tools/__init__.py +0 -0
  70. caudate_cli-0.1.84/execution/tools/agent_tool.py +107 -0
  71. caudate_cli-0.1.84/execution/tools/agentic_tool.py +297 -0
  72. caudate_cli-0.1.84/execution/tools/artifact_tool.py +191 -0
  73. caudate_cli-0.1.84/execution/tools/ask_user_question_tool.py +293 -0
  74. caudate_cli-0.1.84/execution/tools/base.py +81 -0
  75. caudate_cli-0.1.84/execution/tools/calculator_tool.py +137 -0
  76. caudate_cli-0.1.84/execution/tools/cognos_card_tool.py +124 -0
  77. caudate_cli-0.1.84/execution/tools/cron_tool.py +215 -0
  78. caudate_cli-0.1.84/execution/tools/datetime_tool.py +215 -0
  79. caudate_cli-0.1.84/execution/tools/describe_image_tool.py +161 -0
  80. caudate_cli-0.1.84/execution/tools/draw_tool.py +164 -0
  81. caudate_cli-0.1.84/execution/tools/edit_image_tool.py +262 -0
  82. caudate_cli-0.1.84/execution/tools/edit_tool.py +252 -0
  83. caudate_cli-0.1.84/execution/tools/file_tool.py +117 -0
  84. caudate_cli-0.1.84/execution/tools/find_anywhere_tool.py +255 -0
  85. caudate_cli-0.1.84/execution/tools/forge_feature_tools.py +377 -0
  86. caudate_cli-0.1.84/execution/tools/glob_tool.py +59 -0
  87. caudate_cli-0.1.84/execution/tools/grep_tool.py +89 -0
  88. caudate_cli-0.1.84/execution/tools/http_request_tool.py +224 -0
  89. caudate_cli-0.1.84/execution/tools/load_skill_tool.py +104 -0
  90. caudate_cli-0.1.84/execution/tools/longcat_avatar_tool.py +384 -0
  91. caudate_cli-0.1.84/execution/tools/mcp_tool.py +100 -0
  92. caudate_cli-0.1.84/execution/tools/notebook_tool.py +279 -0
  93. caudate_cli-0.1.84/execution/tools/openapi_tool.py +440 -0
  94. caudate_cli-0.1.84/execution/tools/plan_mode_tool.py +281 -0
  95. caudate_cli-0.1.84/execution/tools/push_notification_tool.py +157 -0
  96. caudate_cli-0.1.84/execution/tools/python_tool.py +61 -0
  97. caudate_cli-0.1.84/execution/tools/respond_tool.py +40 -0
  98. caudate_cli-0.1.84/execution/tools/sandbox_tool.py +378 -0
  99. caudate_cli-0.1.84/execution/tools/search_tool.py +153 -0
  100. caudate_cli-0.1.84/execution/tools/semantic_search_tool.py +106 -0
  101. caudate_cli-0.1.84/execution/tools/shell_tool.py +558 -0
  102. caudate_cli-0.1.84/execution/tools/speak_tool.py +134 -0
  103. caudate_cli-0.1.84/execution/tools/storyboard_tool.py +727 -0
  104. caudate_cli-0.1.84/execution/tools/system_info_tool.py +212 -0
  105. caudate_cli-0.1.84/execution/tools/task_tool.py +323 -0
  106. caudate_cli-0.1.84/execution/tools/think_tool.py +49 -0
  107. caudate_cli-0.1.84/execution/tools/todo_tool.py +112 -0
  108. caudate_cli-0.1.84/execution/tools/transcribe_audio_tool.py +86 -0
  109. caudate_cli-0.1.84/execution/tools/update_memory_tool.py +92 -0
  110. caudate_cli-0.1.84/execution/tools/web_fetch_tool.py +82 -0
  111. caudate_cli-0.1.84/execution/tools/worktree_tool.py +174 -0
  112. caudate_cli-0.1.84/llm/__init__.py +0 -0
  113. caudate_cli-0.1.84/llm/fallback.py +116 -0
  114. caudate_cli-0.1.84/llm/models.py +324 -0
  115. caudate_cli-0.1.84/llm/models_dev.py +221 -0
  116. caudate_cli-0.1.84/llm/provider.py +1438 -0
  117. caudate_cli-0.1.84/llm/router.py +452 -0
  118. caudate_cli-0.1.84/main.py +2110 -0
  119. caudate_cli-0.1.84/memory/__init__.py +0 -0
  120. caudate_cli-0.1.84/memory/episodic.py +99 -0
  121. caudate_cli-0.1.84/memory/procedural.py +145 -0
  122. caudate_cli-0.1.84/memory/semantic.py +71 -0
  123. caudate_cli-0.1.84/memory/working.py +64 -0
  124. caudate_cli-0.1.84/nn/__init__.py +43 -0
  125. caudate_cli-0.1.84/nn/auto_evolve.py +245 -0
  126. caudate_cli-0.1.84/nn/caudate.py +136 -0
  127. caudate_cli-0.1.84/nn/config.py +141 -0
  128. caudate_cli-0.1.84/nn/consolidator.py +81 -0
  129. caudate_cli-0.1.84/nn/data.py +1635 -0
  130. caudate_cli-0.1.84/nn/encoder.py +258 -0
  131. caudate_cli-0.1.84/nn/forge_advisor.py +303 -0
  132. caudate_cli-0.1.84/nn/format.py +235 -0
  133. caudate_cli-0.1.84/nn/heads.py +432 -0
  134. caudate_cli-0.1.84/nn/observer.py +994 -0
  135. caudate_cli-0.1.84/nn/policy.py +214 -0
  136. caudate_cli-0.1.84/nn/runtime.py +343 -0
  137. caudate_cli-0.1.84/nn/scorer.py +175 -0
  138. caudate_cli-0.1.84/nn/trainer.py +515 -0
  139. caudate_cli-0.1.84/nn/vision.py +352 -0
  140. caudate_cli-0.1.84/personality/__init__.py +23 -0
  141. caudate_cli-0.1.84/personality/engine.py +129 -0
  142. caudate_cli-0.1.84/personality/identity.py +144 -0
  143. caudate_cli-0.1.84/personality/inner_voice.py +100 -0
  144. caudate_cli-0.1.84/personality/mood.py +205 -0
  145. caudate_cli-0.1.84/planning/__init__.py +0 -0
  146. caudate_cli-0.1.84/planning/dev_server.py +221 -0
  147. caudate_cli-0.1.84/planning/forge_models.py +718 -0
  148. caudate_cli-0.1.84/planning/orchestrator.py +1363 -0
  149. caudate_cli-0.1.84/planning/planner.py +451 -0
  150. caudate_cli-0.1.84/planning/task_graph.py +61 -0
  151. caudate_cli-0.1.84/pyproject.toml +115 -0
  152. caudate_cli-0.1.84/reflection/__init__.py +0 -0
  153. caudate_cli-0.1.84/reflection/meta_learner.py +156 -0
  154. caudate_cli-0.1.84/reflection/reflector.py +127 -0
  155. caudate_cli-0.1.84/setup.cfg +4 -0
  156. caudate_cli-0.1.84/tests/test_agentic_runaway.py +416 -0
  157. caudate_cli-0.1.84/tests/test_chat_format.py +269 -0
  158. caudate_cli-0.1.84/tests/test_citations.py +84 -0
  159. caudate_cli-0.1.84/tests/test_constrained_routing.py +200 -0
  160. caudate_cli-0.1.84/tests/test_contrastive_tool_head.py +201 -0
  161. caudate_cli-0.1.84/tests/test_feature_done_contract.py +58 -0
  162. caudate_cli-0.1.84/tests/test_feature_success_head.py +264 -0
  163. caudate_cli-0.1.84/tests/test_file_refs.py +98 -0
  164. caudate_cli-0.1.84/tests/test_forge_advisor.py +162 -0
  165. caudate_cli-0.1.84/tests/test_forge_force_stop.py +111 -0
  166. caudate_cli-0.1.84/tests/test_forge_models.py +122 -0
  167. caudate_cli-0.1.84/tests/test_forge_observer.py +65 -0
  168. caudate_cli-0.1.84/tests/test_forge_orchestrator_runner.py +132 -0
  169. caudate_cli-0.1.84/tests/test_json_salvage.py +175 -0
  170. caudate_cli-0.1.84/tests/test_llm_fallback.py +171 -0
  171. caudate_cli-0.1.84/tests/test_pi_compat.py +190 -0
  172. caudate_cli-0.1.84/tests/test_scheduler.py +100 -0
  173. caudate_cli-0.1.84/tests/test_settings.py +127 -0
  174. caudate_cli-0.1.84/tests/test_skills_lockfile.py +96 -0
  175. caudate_cli-0.1.84/tests/test_slash_commands.py +125 -0
  176. caudate_cli-0.1.84/tests/test_usage.py +89 -0
  177. caudate_cli-0.1.84/tests/test_vram_estimates.py +65 -0
  178. caudate_cli-0.1.84/ui/__init__.py +5 -0
  179. caudate_cli-0.1.84/ui/display.py +753 -0
  180. caudate_cli-0.1.84/voice/__init__.py +0 -0
  181. caudate_cli-0.1.84/voice/conversation.py +125 -0
  182. caudate_cli-0.1.84/voice/listener.py +111 -0
  183. caudate_cli-0.1.84/voice/speaker.py +59 -0
  184. caudate_cli-0.1.84/voice/stt.py +126 -0
  185. caudate_cli-0.1.84/voice/tts.py +214 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rave Manji
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.
@@ -0,0 +1,384 @@
1
+ Metadata-Version: 2.4
2
+ Name: caudate-cli
3
+ Version: 0.1.84
4
+ Summary: A local-first cognitive agent with a learned router (Caudate) and Claude-SDK-shaped tool palette.
5
+ Author-email: Rave Manji <rahimtz93@googlemail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/raveuk/cognos
8
+ Project-URL: Repository, https://github.com/raveuk/cognos
9
+ Keywords: llm,agent,agentic,cognitive,local-first,tool-use
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: litellm>=1.40.0
21
+ Requires-Dist: chromadb>=0.5.0
22
+ Requires-Dist: pydantic>=2.0.0
23
+ Requires-Dist: SQLAlchemy>=2.0.0
24
+ Requires-Dist: rich>=13.0.0
25
+ Requires-Dist: click>=8.0.0
26
+ Requires-Dist: prompt_toolkit>=3.0.0
27
+ Requires-Dist: fastapi>=0.110.0
28
+ Requires-Dist: uvicorn>=0.29.0
29
+ Requires-Dist: python-multipart>=0.0.9
30
+ Requires-Dist: mcp>=1.0.0
31
+ Requires-Dist: numpy>=1.24.0
32
+ Requires-Dist: httpx>=0.27.0
33
+ Requires-Dist: huggingface_hub>=0.20.0
34
+ Requires-Dist: anthropic>=0.40.0
35
+ Requires-Dist: pypdf>=4.0.0
36
+ Requires-Dist: useful-moonshine-onnx>=0.2.0
37
+ Requires-Dist: kokoro>=0.3.0
38
+ Requires-Dist: soundfile>=0.12.0
39
+ Requires-Dist: piper-tts>=1.4.0
40
+ Requires-Dist: sounddevice>=0.5.0
41
+ Requires-Dist: webrtcvad-wheels>=2.0.10
42
+ Requires-Dist: diffusers>=0.30.0
43
+ Requires-Dist: transformers>=4.40.0
44
+ Requires-Dist: torch>=2.2.0
45
+ Requires-Dist: accelerate>=0.30.0
46
+ Requires-Dist: Pillow>=10.0.0
47
+ Provides-Extra: dev
48
+ Requires-Dist: pytest>=7.0; extra == "dev"
49
+ Dynamic: license-file
50
+
51
+ # Caudate
52
+
53
+ A local-first cognitive agent with Claude-SDK feature parity, built on
54
+ Ollama via LiteLLM. Caudate runs entirely on your hardware by default — no
55
+ API keys, no network calls — but switches to Anthropic, OpenAI, or any
56
+ LiteLLM-supported provider with a one-line config change.
57
+
58
+ It's not a thin chat wrapper. The architecture explicitly separates:
59
+
60
+ - **Memory** — episodic, semantic, procedural, working
61
+ - **Planning** — DAG-based goal decomposition with replanning
62
+ - **Reflection** — meta-learning from past goal outcomes
63
+ - **Personality** — identity, mood, inner voice
64
+ - **Dual-process routing** — fast/slow models picked per call (System 1 / System 2)
65
+
66
+ …with a Claude-Code-style agentic loop on top: real-time tool calls,
67
+ streaming, sessions, hooks, MCP, subagents, permissions, and a
68
+ fully-featured CLI + HTTP API.
69
+
70
+ > Status: feature-complete against its original five-phase roadmap plus
71
+ > Claude SDK extras and Claude Code UX parity. See
72
+ > [`NEXT_ACTIONS.md`](NEXT_ACTIONS.md) for what's done and what's deferred.
73
+
74
+ ---
75
+
76
+ ## Quickstart
77
+
78
+ ### Install from PyPI
79
+
80
+ ```bash
81
+ pipx install caudate-cli
82
+ ```
83
+
84
+ One install gets you everything: dual-brain routing, the Caudate NN
85
+ router, voice (Moonshine STT + Kokoro/Piper TTS), image generation
86
+ (diffusers + FLUX/SDXL), PDF extraction, native Anthropic SDK, and the
87
+ full tool palette. Heavy — pulls torch, transformers, diffusers — but
88
+ you don't have to think about extras.
89
+
90
+ Vision works out of the box: `DescribeImage` routes through whichever
91
+ vision-capable model you pick (`qwen3-vl`, `glm-5v`, `claude-haiku-4-5`,
92
+ GPT-4V, …) so the dependency is your LLM choice, not a separate install.
93
+
94
+ On first launch, `caudate` runs a one-time setup wizard that picks your
95
+ fast/slow models, downloads Caudate's weights from HuggingFace, and writes
96
+ `~/.caudate/settings.json`. After that:
97
+
98
+ ```bash
99
+ caudate # banner + REPL
100
+ caudate doctor # diagnose what's wired (Ollama, Caudate, API keys)
101
+ caudate init --force # re-run the wizard if you change your mind
102
+ ```
103
+
104
+ Requirements:
105
+
106
+ - Python ≥ 3.10
107
+ - [Ollama](https://ollama.com) running locally if you want the local-only or
108
+ hybrid preset (skip if you go hosted-only)
109
+ - An `ANTHROPIC_API_KEY` in your shell *only* if you pick a preset that uses an
110
+ `anthropic/...` model
111
+
112
+ ### Install from source (for development)
113
+
114
+ ```bash
115
+ git clone https://github.com/raveuk/caudate-cli.git
116
+ cd caudate-cli
117
+ python3 -m venv .venv && source .venv/bin/activate
118
+ pip install -e .
119
+ caudate init
120
+ ```
121
+
122
+ ### Talk to it
123
+
124
+ ```bash
125
+ caudate # default — drops into REPL
126
+ caudate interactive --model fast # preset model
127
+ caudate interactive \
128
+ --system1 ollama/qwen2.5-coder:1.5b \
129
+ --system2 ollama/gemma3:27b # explicit dual-brain
130
+ ```
131
+
132
+ A REPL opens. Type to chat. Type `/help` for slash commands.
133
+
134
+ ### 4. Or hit it over HTTP
135
+
136
+ ```bash
137
+ caudate serve --port 8000
138
+ # in another terminal:
139
+ curl -X POST http://127.0.0.1:8000/chat \
140
+ -H 'content-type: application/json' \
141
+ -d '{"message":"what is in this directory?"}'
142
+ ```
143
+
144
+ The HTTP server also hosts a [Web UI](#web-ui) at `http://127.0.0.1:8000/ui`.
145
+
146
+ ### Use Caudate as the backend for Open WebUI
147
+
148
+ Open WebUI is a polished chat UI that talks to any OpenAI-compatible
149
+ endpoint. Caudate exposes both Anthropic-shape (`/v1/messages`) and
150
+ OpenAI-shape (`/v1/chat/completions`) endpoints, so it slots in cleanly:
151
+
152
+ ```bash
153
+ # 1. Start Caudate's API server
154
+ caudate serve --port 8000
155
+
156
+ # 2. In Open WebUI's settings → Connections → OpenAI API
157
+ # Base URL: http://localhost:8000/v1
158
+ # API Key: any non-empty string (Caudate ignores it)
159
+
160
+ # 3. Pick "claude-haiku-4-5", "claude-opus-4-7[1m]", or whichever
161
+ # model id is wired in your ~/.caudate/settings.json
162
+ ```
163
+
164
+ Anything you type in Open WebUI now goes through Caudate's dual-brain
165
+ routing, Caudate the NN router, and the full tool palette. Vision works
166
+ the same way — drop an image into Open WebUI's chat and Caudate routes
167
+ it to whichever vision-capable model you've configured.
168
+
169
+ For voice (`caudate talk`), image generation (`caudate draw`), and the
170
+ Forge autonomous-coding harness, run those commands directly — Open
171
+ WebUI doesn't surface them.
172
+
173
+ ---
174
+
175
+ ## What you get out of the box
176
+
177
+ ### CLI
178
+
179
+ | Command | What it does |
180
+ | --------------------------------- | ------------ |
181
+ | `caudate interactive` | REPL with streaming, slash commands, history, multi-line input |
182
+ | `caudate run <goal>` | Single-shot DAG planner — decomposes a goal, runs it, reflects |
183
+ | `caudate talk` | Voice mode (Moonshine STT + Kokoro TTS, Whisper/Piper fallback) |
184
+ | `caudate draw "<prompt>"` | Generate an image (diffusers / FLUX.1-schnell or SDXL-Turbo) |
185
+ | `caudate caudate {train,eval,status,export}` | Train/inspect Caudate, the learned router/advisor NN |
186
+ | `caudate serve [--port 8000]` | FastAPI HTTP server with SSE streaming |
187
+ | `caudate sessions {list,delete,rename,export}` | Manage saved conversations |
188
+ | `caudate personality {show,set,reset}` | Inspect or tune identity / mood |
189
+ | `caudate models` | List detected Ollama models with capability flags |
190
+ | `caudate router` | Preview routing decisions without calling the LLM |
191
+ | `caudate bench` | Run the benchmark suite |
192
+ | `caudate cron {add,list,remove,run}` | Schedule recurring prompts |
193
+ | `caudate mcp-serve` | Run Caudate as an MCP server |
194
+ | `caudate update` | Self-update (git pull or pip upgrade) |
195
+ | `caudate info` | List registered tools and learned strategies |
196
+
197
+ ### Slash commands (inside the REPL)
198
+
199
+ `/help`, `/clear`, `/compact`, `/model <id|fast|balanced|powerful>`,
200
+ `/cost`, `/tools`, `/sessions`, `/export <md|json|html>`, `/files`,
201
+ `/permissions <mode>`, `/personality`, `/router`, `/diff <path>`,
202
+ `/status`, `/cron`, `/bg`, `/notify`, `/think on|off`, `/save`,
203
+ `/quit`. Type `/help` for the full list with descriptions.
204
+
205
+ ### Tools the agent can call
206
+
207
+ ~38 built-in tools, including: `Bash`, `Read`, `Write`, `Edit`, `Glob`,
208
+ `Grep`, `WebSearch`, `WebFetch`, `PythonExec`, `Think`, `Respond`,
209
+ `Agent` (subagents), `Draw`, `EditImage`, `DescribeImage`, `Speak`,
210
+ `TranscribeAudio`, `Storyboard`, `Sandbox`, `Calculator`, `DateTime`,
211
+ `HttpRequest`, `OpenAPI`, `Notebook`, `Cron`, `PushNotification`,
212
+ `AskUserQuestion`, `LoadSkill`, `UpdateMemory`, `MCP`, `Worktree`,
213
+ `PlanMode`, `FindAnywhere`, `SemanticSearch`, `SystemInfo`, `Task`,
214
+ `CognosCard`, `Artifact`, `Agentic`. Drop a `plugins/*.py` exposing
215
+ `PLUGIN = ToolInstance` to add your own.
216
+
217
+ ### Caudate — the learned brain
218
+
219
+ Caudate ships with **Caudate**, a small PyTorch transformer that learns
220
+ your tool-use patterns turn-by-turn. It observes every conversation,
221
+ auto-trains in the background once it has enough samples, and graduates
222
+ through trust levels (SILENT → OBSERVER → WHISPER → ADVISOR → CONTROLLER)
223
+ based on rolling accuracy. At WHISPER it whispers a hint into the LLM
224
+ prompt; at ADVISOR it can override tier routing.
225
+
226
+ See `CAUDATE.md` for the full architecture, `nn/` for the code,
227
+ `data/nn/` for the live checkpoint and replay buffer.
228
+
229
+ ### Multi-modal in / out
230
+
231
+ - **`@file` references** — `look at @config.py` inlines or attaches the file.
232
+ - **Drag-and-drop images / PDFs** — paths in the prompt are auto-uploaded via the Files API.
233
+ - **`POST /files`** — same Files API exposed over HTTP.
234
+ - **Citations** — pass `documents=[{id,title,text}]` and the model can emit `[[cite:doc:Lx]]` markers, post-processed into structured `CitationBlock` objects.
235
+
236
+ ---
237
+
238
+ ## Architecture
239
+
240
+ ```
241
+ ┌──────────────────────────────────────────────────┐
242
+ │ CognosAgent │
243
+ │ │
244
+ user input ─┼─► AgenticLoop ◄──► Executor ──► tools/ │
245
+ │ │ ▲ │
246
+ │ │ │ │
247
+ │ ▼ │ │
248
+ │ Personality ─► hooks ──┘ │
249
+ │ │ │
250
+ │ ▼ │
251
+ │ LLM Router (DualLLMProvider) │
252
+ │ ├── System 1: fast model │
253
+ │ └── System 2: slow model │
254
+ │ │
255
+ │ Memory: episodic | semantic | procedural | working
256
+ │ Session persistence + context compaction │
257
+ │ Permissions (modes + allow/deny rules + audit) │
258
+ │ MCP clients (cognos_mcp/) │
259
+ │ Subagents (workspace-isolated via git worktrees)│
260
+ └──────────────────────────────────────────────────┘
261
+ ```
262
+
263
+ Each subsystem is documented in `BUILD_LOG.md`. The
264
+ [Claude SDK Extras](NEXT_ACTIONS.md#claude-sdk-extras-done) and
265
+ [Claude Code UX Parity](NEXT_ACTIONS.md#claude-code-ux-parity-done) sections
266
+ in `NEXT_ACTIONS.md` enumerate what's wired and where.
267
+
268
+ ---
269
+
270
+ ## Configuration
271
+
272
+ Three layers, last wins:
273
+
274
+ 1. Built-in defaults in `core/settings.py`
275
+ 2. `~/.caudate/settings.json` — per-user
276
+ 3. `./.caudate/settings.json` — per-project
277
+
278
+ Example:
279
+
280
+ ```json
281
+ {
282
+ "model": "ollama/gemma3:27b",
283
+ "permission_mode": "default",
284
+ "fallback_models": ["ollama/qwen2.5-coder:1.5b"],
285
+ "permissions": {
286
+ "allow": [{"tool": "Bash", "pattern": "^(ls|cat|grep)"}],
287
+ "deny": [{"tool": "Bash", "pattern": "rm -rf"}]
288
+ },
289
+ "statusline": "{model} | {mood} | tok={tokens} | ${cost:.4f}",
290
+ "notifications": {"enabled": true, "on_long_task_seconds": 30}
291
+ }
292
+ ```
293
+
294
+ CLI flags always override settings (`--model fast`, `--permissions plan`).
295
+
296
+ ---
297
+
298
+ ## Web UI
299
+
300
+ A zero-build single-page UI ships with the HTTP server:
301
+
302
+ ```bash
303
+ caudate serve --port 8000
304
+ # open http://127.0.0.1:8000/ui
305
+ ```
306
+
307
+ It speaks to `POST /chat/stream` (SSE), supports session resume,
308
+ file attachments, and slash-style commands. Source: `ui/web/`.
309
+
310
+ ---
311
+
312
+ ## IDE plugins
313
+
314
+ - `ide/vscode/` — TypeScript extension. Sidebar webview, "Ask about
315
+ selection" right-click, configurable API URL / model / permission mode.
316
+ - `ide/jetbrains/` — Kotlin plugin for IntelliJ-platform IDEs (IDEA,
317
+ PyCharm, GoLand, WebStorm, RustRover, …). Tool window, editor action,
318
+ settings page.
319
+
320
+ Both are thin clients — they make HTTP calls to a running `caudate serve`
321
+ process, no LLM runs in the IDE.
322
+
323
+ ---
324
+
325
+ ## Optional extras
326
+
327
+ `pip install`-flagged features that are no-ops without their dep:
328
+
329
+ | Extra | Unlocks |
330
+ | ------------ | ------- |
331
+ | `anthropic` | Real prompt caching, native extended thinking, native `response_format` for `claude-*` model ids |
332
+ | `pypdf` | PDF text extraction in the Files API |
333
+ | `prompt_toolkit` | Multi-line input + persistent history + Ctrl+R + slash completion |
334
+ | `fastapi` + `uvicorn` | The HTTP server (`caudate serve`) |
335
+ | `mcp` | The MCP server / client (`caudate mcp-serve`) |
336
+ | `useful-moonshine-onnx` + `kokoro` + `piper-tts` + `sounddevice` | Voice mode (`caudate talk`) |
337
+ | `diffusers` + `transformers` + `torch` | Image generation (`caudate draw`) |
338
+ | `torch` + `sentence-transformers` | Caudate (the learned router NN) |
339
+
340
+ Caudate runs without any of them — they degrade gracefully.
341
+
342
+ ---
343
+
344
+ ## Project layout
345
+
346
+ ```
347
+ core/ agent, agentic loop, sessions, hooks, permissions, files,
348
+ citations, settings, slash commands, …
349
+ execution/ tool registry + 12 built-in tools + plugin loader
350
+ llm/ LiteLLM provider, model registry, dual-process router,
351
+ fallback chains
352
+ memory/ episodic / semantic / procedural / working
353
+ planning/ DAG planner, task graph
354
+ reflection/ reflector, meta-learner
355
+ personality/ identity, mood, inner voice
356
+ cognos_mcp/ MCP server, client, bridge
357
+ api/ FastAPI HTTP server
358
+ bench/ benchmark suite
359
+ plugins/ drop-in tools (`PLUGIN = ToolInstance`)
360
+ ide/vscode/ VS Code extension
361
+ ide/jetbrains/ JetBrains plugin
362
+ ui/ terminal display + web UI
363
+ data/ local state — sessions, files, manifests, audit log
364
+ ```
365
+
366
+ ---
367
+
368
+ ## Why local-first?
369
+
370
+ Three reasons:
371
+
372
+ 1. **Privacy.** Code, conversations, and learned strategies live on disk.
373
+ 2. **Cost.** A small Ollama model runs at $0/turn and answers in milliseconds for routine work.
374
+ 3. **Sovereignty.** No vendor outage takes you offline; no rate limit slows you down.
375
+
376
+ The dual-process router exists so you can keep most turns on a small
377
+ local model and only escalate hard turns to a heavy one (which can
378
+ itself be local — or Anthropic/OpenAI when you're online).
379
+
380
+ ---
381
+
382
+ ## License
383
+
384
+ MIT — see [LICENSE](LICENSE). © 2026 Rave Manji.