mishkan-harness 0.1.0

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 (186) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +205 -0
  3. package/bin/mishkan.js +221 -0
  4. package/docs/design/MISHKAN_agent_aliases.md +140 -0
  5. package/docs/design/MISHKAN_decisions.md +172 -0
  6. package/docs/design/MISHKAN_harness_design.md +820 -0
  7. package/docs/design/MISHKAN_ontology.md +87 -0
  8. package/docs/design/MISHKAN_token_optimisation.md +181 -0
  9. package/docs/engineer/README.md +37 -0
  10. package/docs/engineer/profile.example.md +79 -0
  11. package/docs/usage/01-installation.md +178 -0
  12. package/docs/usage/02-project-init.md +151 -0
  13. package/docs/usage/03-orchestration.md +218 -0
  14. package/docs/usage/04-memory-layer.md +201 -0
  15. package/docs/usage/05-selective-ingest.md +177 -0
  16. package/docs/usage/06-llm-providers.md +195 -0
  17. package/docs/usage/07-troubleshooting.md +316 -0
  18. package/docs/usage/08-glossary.md +154 -0
  19. package/docs/usage/09-workflows.md +123 -0
  20. package/docs/usage/README.md +77 -0
  21. package/package.json +43 -0
  22. package/payload/install/settings.hooks.json +47 -0
  23. package/payload/mishkan/AGENT_SPEC.md +154 -0
  24. package/payload/mishkan/agents/ahikam.md +58 -0
  25. package/payload/mishkan/agents/aholiab.md +68 -0
  26. package/payload/mishkan/agents/asaph.md +73 -0
  27. package/payload/mishkan/agents/baruch.md +88 -0
  28. package/payload/mishkan/agents/benaiah.md +76 -0
  29. package/payload/mishkan/agents/bezalel.md +83 -0
  30. package/payload/mishkan/agents/caleb.md +74 -0
  31. package/payload/mishkan/agents/deborah.md +63 -0
  32. package/payload/mishkan/agents/elasah.md +58 -0
  33. package/payload/mishkan/agents/eliashib.md +68 -0
  34. package/payload/mishkan/agents/ezra.md +69 -0
  35. package/payload/mishkan/agents/hanun.md +64 -0
  36. package/payload/mishkan/agents/hiram.md +68 -0
  37. package/payload/mishkan/agents/hizkiah.md +76 -0
  38. package/payload/mishkan/agents/huldah.md +59 -0
  39. package/payload/mishkan/agents/huram.md +66 -0
  40. package/payload/mishkan/agents/hushai.md +59 -0
  41. package/payload/mishkan/agents/igal.md +58 -0
  42. package/payload/mishkan/agents/ira.md +86 -0
  43. package/payload/mishkan/agents/jahaziel.md +71 -0
  44. package/payload/mishkan/agents/jakin.md +66 -0
  45. package/payload/mishkan/agents/jehonathan.md +62 -0
  46. package/payload/mishkan/agents/jehoshaphat.md +68 -0
  47. package/payload/mishkan/agents/joab.md +71 -0
  48. package/payload/mishkan/agents/joah.md +62 -0
  49. package/payload/mishkan/agents/maaseiah.md +61 -0
  50. package/payload/mishkan/agents/meremoth.md +65 -0
  51. package/payload/mishkan/agents/meshullam.md +67 -0
  52. package/payload/mishkan/agents/nathan.md +70 -0
  53. package/payload/mishkan/agents/nehemiah.md +93 -0
  54. package/payload/mishkan/agents/obed.md +60 -0
  55. package/payload/mishkan/agents/oholiab.md +67 -0
  56. package/payload/mishkan/agents/palal.md +63 -0
  57. package/payload/mishkan/agents/phinehas.md +73 -0
  58. package/payload/mishkan/agents/rehum.md +60 -0
  59. package/payload/mishkan/agents/salma.md +69 -0
  60. package/payload/mishkan/agents/seraiah.md +73 -0
  61. package/payload/mishkan/agents/shallum.md +66 -0
  62. package/payload/mishkan/agents/shaphan.md +64 -0
  63. package/payload/mishkan/agents/shemaiah.md +67 -0
  64. package/payload/mishkan/agents/shevna.md +58 -0
  65. package/payload/mishkan/agents/uriah.md +70 -0
  66. package/payload/mishkan/agents/zaccur.md +58 -0
  67. package/payload/mishkan/agents/zadok.md +67 -0
  68. package/payload/mishkan/agents/zerubbabel.md +69 -0
  69. package/payload/mishkan/cognee/.env.curated.example +61 -0
  70. package/payload/mishkan/cognee/.env.example +165 -0
  71. package/payload/mishkan/cognee/Dockerfile +50 -0
  72. package/payload/mishkan/cognee/README.md +129 -0
  73. package/payload/mishkan/cognee/docker-compose.curated-ui.yml +61 -0
  74. package/payload/mishkan/cognee/docker-compose.curated.yml +85 -0
  75. package/payload/mishkan/cognee/docker-compose.hardening.yml +16 -0
  76. package/payload/mishkan/cognee/docker-compose.selfhosted.yml +114 -0
  77. package/payload/mishkan/cognee/docker-compose.ui.yml +70 -0
  78. package/payload/mishkan/cognee/docker-compose.yml +71 -0
  79. package/payload/mishkan/cognee/ingest-curated.py +92 -0
  80. package/payload/mishkan/commands/dep-audit.md +24 -0
  81. package/payload/mishkan/commands/mishkan-init.md +25 -0
  82. package/payload/mishkan/commands/mishkan-resume.md +21 -0
  83. package/payload/mishkan/commands/promote.md +19 -0
  84. package/payload/mishkan/commands/sefer-pull.md +19 -0
  85. package/payload/mishkan/commands/sprint-close.md +21 -0
  86. package/payload/mishkan/config/curated-library.yaml +113 -0
  87. package/payload/mishkan/config/improvement-queries.md +29 -0
  88. package/payload/mishkan/config/model-routing.yaml +87 -0
  89. package/payload/mishkan/config/projects.yaml +38 -0
  90. package/payload/mishkan/evals/baruch/README.md +93 -0
  91. package/payload/mishkan/evals/baruch/fixtures/invalid/bad-outcome-enum.json +15 -0
  92. package/payload/mishkan/evals/baruch/fixtures/invalid/bad-sprint-pattern.json +15 -0
  93. package/payload/mishkan/evals/baruch/fixtures/invalid/bad-trigger-enum.json +15 -0
  94. package/payload/mishkan/evals/baruch/fixtures/invalid/malformed-json.json +7 -0
  95. package/payload/mishkan/evals/baruch/fixtures/invalid/missing-required-field.json +14 -0
  96. package/payload/mishkan/evals/baruch/fixtures/valid/blocked-vendor.json +15 -0
  97. package/payload/mishkan/evals/baruch/fixtures/valid/curated-shortcircuit.json +15 -0
  98. package/payload/mishkan/evals/baruch/fixtures/valid/partial-no-write.json +14 -0
  99. package/payload/mishkan/evals/baruch/fixtures/valid/resolved-cross-harness.json +15 -0
  100. package/payload/mishkan/evals/baruch/golden_case/expected.yaml +35 -0
  101. package/payload/mishkan/evals/baruch/golden_case/input.yaml +47 -0
  102. package/payload/mishkan/evals/baruch/golden_case/produced.json +15 -0
  103. package/payload/mishkan/evals/baruch/run.sh +129 -0
  104. package/payload/mishkan/hooks/model-route.py +96 -0
  105. package/payload/mishkan/hooks/post-tool-observe.sh +45 -0
  106. package/payload/mishkan/hooks/pre-tool-security.sh +150 -0
  107. package/payload/mishkan/hooks/session-start.sh +20 -0
  108. package/payload/mishkan/hooks/stop-reporter.sh +29 -0
  109. package/payload/mishkan/ontology.md +87 -0
  110. package/payload/mishkan/rules/backend/yasad.md +23 -0
  111. package/payload/mishkan/rules/common/dependencies.md +53 -0
  112. package/payload/mishkan/rules/common/quality.md +16 -0
  113. package/payload/mishkan/rules/common/security.md +20 -0
  114. package/payload/mishkan/rules/documentation/sefer.md +19 -0
  115. package/payload/mishkan/rules/frontend/panim.md +21 -0
  116. package/payload/mishkan/rules/infrastructure/migdal.md +22 -0
  117. package/payload/mishkan/scripts/dependency-audit.sh +171 -0
  118. package/payload/mishkan/scripts/ensure-curated-box.sh +66 -0
  119. package/payload/mishkan/scripts/mishkan-ingest.sh +92 -0
  120. package/payload/mishkan/scripts/observability-aggregate.sh +57 -0
  121. package/payload/mishkan/scripts/seed-curated-library.sh +62 -0
  122. package/payload/mishkan/scripts/sync-profile.sh +65 -0
  123. package/payload/mishkan/scripts/validate-research-log.sh +108 -0
  124. package/payload/mishkan/skills/asaph-a11y-seo-craft/SKILL.md +289 -0
  125. package/payload/mishkan/skills/baruch-research-reporting-craft/SKILL.md +460 -0
  126. package/payload/mishkan/skills/benaiah-devsecops-craft/SKILL.md +329 -0
  127. package/payload/mishkan/skills/bezalel-cto-craft/SKILL.md +391 -0
  128. package/payload/mishkan/skills/caleb-web-research-craft/SKILL.md +306 -0
  129. package/payload/mishkan/skills/cognee-promote/SKILL.md +40 -0
  130. package/payload/mishkan/skills/cognee-quickstart/SKILL.md +66 -0
  131. package/payload/mishkan/skills/context-compress/SKILL.md +36 -0
  132. package/payload/mishkan/skills/deborah-ux-craft/SKILL.md +295 -0
  133. package/payload/mishkan/skills/dependency-audit/SKILL.md +59 -0
  134. package/payload/mishkan/skills/dependency-vetting/SKILL.md +59 -0
  135. package/payload/mishkan/skills/documentation-craft/SKILL.md +468 -0
  136. package/payload/mishkan/skills/ezra-research-formulation-craft/SKILL.md +319 -0
  137. package/payload/mishkan/skills/hanun-observability-craft/SKILL.md +312 -0
  138. package/payload/mishkan/skills/hiram-ui-craft/SKILL.md +334 -0
  139. package/payload/mishkan/skills/hizkiah-implementation-craft/SKILL.md +701 -0
  140. package/payload/mishkan/skills/hushai-security-advisor-craft/SKILL.md +282 -0
  141. package/payload/mishkan/skills/ira-code-security-craft/SKILL.md +553 -0
  142. package/payload/mishkan/skills/jakin-intent-clarification-craft/SKILL.md +299 -0
  143. package/payload/mishkan/skills/jehonathan-publication-craft/SKILL.md +262 -0
  144. package/payload/mishkan/skills/joab-app-security-craft/SKILL.md +266 -0
  145. package/payload/mishkan/skills/meremoth-devops-craft/SKILL.md +298 -0
  146. package/payload/mishkan/skills/meshullam-infra-design-craft/SKILL.md +302 -0
  147. package/payload/mishkan/skills/mishkan-ingest/SKILL.md +65 -0
  148. package/payload/mishkan/skills/mishkan-init/SKILL.md +65 -0
  149. package/payload/mishkan/skills/nathan-architecture-craft/SKILL.md +547 -0
  150. package/payload/mishkan/skills/nehemiah-pm-craft/SKILL.md +484 -0
  151. package/payload/mishkan/skills/obed-asset-pipeline-craft/SKILL.md +286 -0
  152. package/payload/mishkan/skills/oholiab-design-system-craft/SKILL.md +334 -0
  153. package/payload/mishkan/skills/palal-systems-craft/SKILL.md +281 -0
  154. package/payload/mishkan/skills/qa-evaluation-craft/SKILL.md +406 -0
  155. package/payload/mishkan/skills/rehum-sre-advisor-craft/SKILL.md +228 -0
  156. package/payload/mishkan/skills/reporter-discipline-craft/SKILL.md +351 -0
  157. package/payload/mishkan/skills/research-pipeline/SKILL.md +55 -0
  158. package/payload/mishkan/skills/salma-frontend-implementation-craft/SKILL.md +369 -0
  159. package/payload/mishkan/skills/sefer-pull/SKILL.md +37 -0
  160. package/payload/mishkan/skills/shallum-database-craft/SKILL.md +347 -0
  161. package/payload/mishkan/skills/shaphan-summarisation-craft/SKILL.md +271 -0
  162. package/payload/mishkan/skills/shemaiah-evaluation-craft/SKILL.md +342 -0
  163. package/payload/mishkan/skills/sprint-report/SKILL.md +28 -0
  164. package/payload/mishkan/skills/team-lead-craft/SKILL.md +457 -0
  165. package/payload/mishkan/skills/zadok-contract-craft/SKILL.md +520 -0
  166. package/payload/mishkan/templates/case-node.schema.json +22 -0
  167. package/payload/mishkan/templates/mcp.json +22 -0
  168. package/payload/mishkan/templates/observability-log.schema.json +24 -0
  169. package/payload/mishkan/templates/project-CLAUDE.md +47 -0
  170. package/payload/mishkan/templates/research-log.schema.json +40 -0
  171. package/payload/mishkan/templates/settings.json +12 -0
  172. package/payload/mishkan/templates/settings.local.json +6 -0
  173. package/payload/mishkan/templates/sprint-state.schema.json +47 -0
  174. package/payload/mishkan/templates/team-report.schema.json +50 -0
  175. package/payload/mishkan/templates/user-CLAUDE.md +62 -0
  176. package/payload/mishkan/workflows/README.md +88 -0
  177. package/payload/mishkan/workflows/mishkan-architecture-panel.js +156 -0
  178. package/payload/mishkan/workflows/mishkan-codebase-audit.js +188 -0
  179. package/payload/mishkan/workflows/mishkan-deep-research.js +251 -0
  180. package/payload/mishkan/workflows/mishkan-init.js +156 -0
  181. package/payload/mishkan/workflows/mishkan-migration-wave.js +180 -0
  182. package/payload/mishkan/workflows/mishkan-release-readiness.js +163 -0
  183. package/payload/mishkan/workflows/mishkan-sprint-close.js +112 -0
  184. package/payload/user/CLAUDE.md +62 -0
  185. package/payload/user/rules/engineer-standards.md +66 -0
  186. package/payload/user/rules/y4nn-standards.md +167 -0
@@ -0,0 +1,165 @@
1
+ # MISHKAN cognee-mcp — environment template.
2
+ # Copy to `.env` and manage the real file with SOPS/age (rule: no plaintext
3
+ # secrets in version control). The real `.env` is gitignored.
4
+ #
5
+ # cp .env.example .env
6
+ # sops --encrypt --age <your-age-recipient> .env > .env.enc # commit .env.enc only
7
+ # sops --decrypt .env.enc > .env # locally, before `up`
8
+
9
+ # REQUIRED. The LLM key cognee uses (OpenAI key by default). SOPS-managed.
10
+ LLM_API_KEY=CHANGEME-use-sops
11
+
12
+ # Pin the cognee git tag/commit the image builds from — never floating.
13
+ # Used as the Dockerfile build arg AND the built image tag. Confirm a release
14
+ # at https://github.com/topoteretes/cognee/releases.
15
+ COGNEE_MCP_REF=v1.1.0
16
+
17
+ # Host port for the cognee-mcp HTTP transport (container listens on 7777). <= 65535.
18
+ COGNEE_PORT=7777
19
+
20
+ # OPTIONAL — backend stores. Defaults are local/embedded (no extra services):
21
+ # relational = sqlite · vector = lancedb · graph = networkx (file .pkl)
22
+ # Each layer is swappable by an env var (values below are Cognee's accepted set):
23
+ #
24
+ # DB_PROVIDER=sqlite|postgres
25
+ # VECTOR_DB_PROVIDER=lancedb|pgvector|qdrant|weaviate
26
+ # GRAPH_DATABASE_PROVIDER=networkx|kuzu|neo4j
27
+ # GRAPH_DATABASE_URL=<graph connection string, for neo4j>
28
+ # DB_HOST=<relational host, for postgres>
29
+ #
30
+ # Low-ops recommendation: if you already run PostgreSQL + pgvector, reuse them;
31
+ # kuzu keeps the graph embedded (no second server):
32
+ # DB_PROVIDER=postgres
33
+ # VECTOR_DB_PROVIDER=pgvector
34
+ # GRAPH_DATABASE_PROVIDER=kuzu
35
+ # (use GRAPH_DATABASE_PROVIDER=neo4j instead only if you want Neo4j's graph UI.)
36
+ # Add any backend service to docker-compose.yml and SOPS-manage its credentials.
37
+ # EMBEDDING_API_KEY=CHANGEME-use-sops # if your embedding provider differs from LLM
38
+
39
+ # --- OPTIONAL: Cognee UI / Graph Explorer (docker-compose.ui.yml, profile: ui) ---
40
+ # Visualise the graph your agents build. Requires a SHARED graph backend so the
41
+ # UI and cognee-mcp see the same graph — use Neo4j:
42
+ # GRAPH_DATABASE_PROVIDER=neo4j
43
+ # GRAPH_DATABASE_URL=bolt://neo4j:7687
44
+ # GRAPH_DB_USERNAME=neo4j
45
+ # GRAPH_DB_PASSWORD=CHANGEME-use-sops
46
+ # Path to a CLONED cognee repo (the UI backend + frontend build from it):
47
+ # COGNEE_SRC=/absolute/path/to/cloned/cognee
48
+ # UI ports (127.0.0.1-bound, <= 65535):
49
+ # COGNEE_BACKEND_PORT=7737
50
+ # COGNEE_UI_PORT=7724
51
+ # NEO4J_HTTP_PORT=7716
52
+ # NEO4J_BOLT_PORT=7709
53
+
54
+ # =============================================================================
55
+ # LLM PROVIDER PROFILES — pick ONE. Cognee resolves providers through litellm,
56
+ # so model names carry a `<provider>/` prefix. Switching providers = set the
57
+ # LLM_* and EMBEDDING_* block below, then recreate the services that read this
58
+ # file:
59
+ # docker compose ... up -d --force-recreate cognee-mcp cognee-backend
60
+ # Keys are secrets — keep them SOPS-managed, never inline in a committed file.
61
+ #
62
+ # Caveat (load-bearing): Anthropic/Claude ships NO embedding model. If you run
63
+ # Claude for the LLM you MUST pair it with a different embedding provider
64
+ # (OpenAI, Gemini, or local Ollama). Every other profile can self-pair.
65
+ # Embedding dimensions are not free to change after first ingest — re-embedding
66
+ # an existing graph means wiping the vector store. Pick the dimension once.
67
+ #
68
+ # LLM and EMBEDDING providers are INDEPENDENT — mix them. A strong combo:
69
+ # Gemini cloud LLM (fast extraction) + LOCAL Ollama embeddings. Bulk ingest
70
+ # (e.g. seeding ~100 curated nodes) fires many embedding calls in a burst;
71
+ # cloud free-tier embeddings 429 (RESOURCE_EXHAUSTED) on that. Local Ollama
72
+ # embeddings are free and unrate-limited, so seeding/ingest never stalls. Use
73
+ # the PROFILE A embedding block with any cloud LLM above.
74
+ #
75
+ # --- PROFILE A: fully self-hosted (Ollama) — DEFAULT, no external key/quota ---
76
+ # Needs docker-compose.selfhosted.yml (ships Ollama). CPU inference is slow but
77
+ # has NO rate/daily cap — the reliable choice for bulk cognify and for PII-bearing
78
+ # project data (nothing leaves the host). qwen2.5:3b is the recommended local LLM:
79
+ # denser reasoning + better data-extraction than llama3.2:3b at the same size,
80
+ # 128K context — well suited to cognee's entity/relationship extraction.
81
+ # OLLAMA_VERSION=<pinned ollama tag> # never :latest
82
+ # LLM_PROVIDER=ollama
83
+ # LLM_MODEL=qwen2.5:3b # or llama3.1:8b if RAM allows
84
+ # LLM_ENDPOINT=http://ollama:11434/v1
85
+ # LLM_API_KEY=ollama # sentinel, not a secret
86
+ # EMBEDDING_PROVIDER=ollama
87
+ # EMBEDDING_MODEL=nomic-embed-text:latest
88
+ # EMBEDDING_ENDPOINT=http://ollama:11434/api/embed
89
+ # EMBEDDING_DIMENSIONS=768
90
+ # HUGGINGFACE_TOKENIZER=nomic-ai/nomic-embed-text-v1.5
91
+ #
92
+ # --- PROFILE B: Google Gemini (cloud, self-pairs LLM + embeddings) -----------
93
+ # Needs a billing-enabled key — a bare free-tier key returns 429 RESOURCE_EXHAUSTED
94
+ # on generateContent. Verify the key with ?key= ListModels before wiring.
95
+ # LLM_PROVIDER=gemini
96
+ # LLM_MODEL=gemini/gemini-2.5-flash # 2.0-flash deprecated 2026-03, shut down ~2026-06
97
+ # LLM_API_KEY=CHANGEME-use-sops # Google AI Studio key
98
+ # EMBEDDING_PROVIDER=gemini
99
+ # EMBEDDING_MODEL=gemini/gemini-embedding-001 # text-embedding-004 is retired on v1beta
100
+ # EMBEDDING_DIMENSIONS=3072 # gemini-embedding-001 native output
101
+ # # leave LLM_ENDPOINT / EMBEDDING_ENDPOINT unset (litellm has Gemini routes)
102
+ #
103
+ # --- PROFILE C: OpenAI (cloud, self-pairs) -----------------------------------
104
+ # LLM_PROVIDER=openai
105
+ # LLM_MODEL=openai/gpt-5-mini
106
+ # LLM_API_KEY=CHANGEME-use-sops
107
+ # EMBEDDING_PROVIDER=openai
108
+ # EMBEDDING_MODEL=openai/text-embedding-3-large
109
+ # EMBEDDING_DIMENSIONS=3072
110
+ #
111
+ # --- PROFILE D: Anthropic/Claude LLM + OpenAI embeddings (MUST split) ---------
112
+ # LLM_PROVIDER=anthropic
113
+ # LLM_MODEL=anthropic/claude-sonnet-4-5
114
+ # LLM_API_KEY=CHANGEME-use-sops # Anthropic key
115
+ # EMBEDDING_PROVIDER=openai # Claude has no embeddings
116
+ # EMBEDDING_MODEL=openai/text-embedding-3-large
117
+ # EMBEDDING_DIMENSIONS=3072
118
+ # EMBEDDING_API_KEY=CHANGEME-use-sops # separate OpenAI key
119
+ #
120
+ # --- PROFILE E: NVIDIA API Catalog (cloud, free to test, OpenAI-compatible) ---
121
+ # RECOMMENDED low-cost cloud option for bulk cognify: NVIDIA hosts the models,
122
+ # no hardware, OpenAI-compatible REST. Sign up at build.nvidia.com, pick a model,
123
+ # "Get API Key". Generous free testing tier — good middle ground between the
124
+ # free-Gemini daily wall and slow local Ollama. Same pattern fits OpenRouter/
125
+ # DeepInfra. Pair embeddings with local Ollama (the gateway need not serve them).
126
+ # LLM_PROVIDER=custom
127
+ # LLM_MODEL=openai/meta/llama-3.1-70b-instruct # NVIDIA catalog model id, openai/ prefix
128
+ # LLM_ENDPOINT=https://integrate.api.nvidia.com/v1
129
+ # LLM_API_KEY=CHANGEME-use-sops # nvapi-... key from the catalog
130
+ # EMBEDDING_PROVIDER=ollama # local embeddings (free, no rate wall)
131
+ # EMBEDDING_MODEL=nomic-embed-text:latest
132
+ # EMBEDDING_ENDPOINT=http://ollama:11434/api/embed
133
+ # EMBEDDING_DIMENSIONS=768
134
+ # HUGGINGFACE_TOKENIZER=nomic-ai/nomic-embed-text-v1.5
135
+
136
+ # Cognee 1.x defaults multi-user access control ON, whose handler is incompatible
137
+ # with neo4j. Single-user self-host → disable it:
138
+ ENABLE_BACKEND_ACCESS_CONTROL=false
139
+
140
+ # Secured default user — OVERRIDE Cognee's built-in default_user@example.com + default
141
+ # password. Even with access control off, set these so the well-known defaults don't work.
142
+ DEFAULT_USER_EMAIL=you@example.com
143
+ DEFAULT_USER_PASSWORD=CHANGEME-use-sops
144
+
145
+ # Local CPU models can exceed cognee preflight 30s LLM check; skip it (real calls work).
146
+ COGNEE_SKIP_CONNECTION_TEST=true
147
+
148
+ # Throttle cognify's LLM calls under a cloud free-tier ceiling. cognify fires many
149
+ # extraction calls per document; on a free cloud tier (Gemini ~10-15 RPM) bulk
150
+ # ingest 429s and runs ERROR (cognee reports status 422). Self-pacing keeps bulk
151
+ # seeding/ingest reliable. Tune REQUESTS to your provider's per-minute cap; leave
152
+ # disabled for local Ollama (no rate limit). Note: a daily cap (RPD) is a separate
153
+ # wall this does not solve — for large bulk on a tight free tier, use local Ollama.
154
+ LLM_RATE_LIMIT_ENABLED=true
155
+ LLM_RATE_LIMIT_REQUESTS=8
156
+ LLM_RATE_LIMIT_INTERVAL=60
157
+
158
+ # Persist cognee's ingested-file + system storage on the cognee_data volume.
159
+ # By default cognee writes to a venv-relative .cognee_data/.cognee_system path in
160
+ # the container's ephemeral layer — every `up --force-recreate` wipes the ingested
161
+ # source files and a later cognify fails with FileNotFoundError (status 422).
162
+ # These roots sit under the volume mount (/app/cognee-mcp/.cognee_system), which
163
+ # the Dockerfile pre-creates as the cognee user so a fresh volume is writable.
164
+ DATA_ROOT_DIRECTORY=/app/cognee-mcp/.cognee_system/data
165
+ SYSTEM_ROOT_DIRECTORY=/app/cognee-mcp/.cognee_system/system
@@ -0,0 +1,50 @@
1
+ # MISHKAN — cognee-mcp server image (HTTP transport on 7777).
2
+ # Builds the official cognee-mcp (topoteretes/cognee · cognee-mcp/) at a PINNED
3
+ # git ref. Cognee core is a Python library; cognee-mcp exposes it over MCP.
4
+ # Refs: https://docs.cognee.ai/cognee-mcp/mcp-local-setup
5
+
6
+ ARG PYTHON_VERSION=3.12-slim
7
+ FROM python:${PYTHON_VERSION}
8
+
9
+ # Pin the cognee git tag or commit — build fails if unset (no floating refs).
10
+ ARG COGNEE_MCP_REF
11
+ RUN test -n "$COGNEE_MCP_REF" || (echo "ERROR: set COGNEE_MCP_REF to a pinned cognee git tag/commit" >&2 && false)
12
+
13
+ ENV PYTHONUNBUFFERED=1 \
14
+ PIP_NO_CACHE_DIR=1 \
15
+ COGNEE_PORT=7777
16
+
17
+ RUN apt-get update \
18
+ && apt-get install -y --no-install-recommends git ca-certificates \
19
+ && rm -rf /var/lib/apt/lists/* \
20
+ && pip install --no-cache-dir uv
21
+
22
+ # Non-root runtime user (least privilege). Own /app BEFORE the heavy steps and
23
+ # run them as `cognee`, so the multi-GB venv is created with correct ownership —
24
+ # avoids a final `chown -R /app` that takes 20+ min over the ML dependency tree.
25
+ RUN useradd --create-home --uid 10001 cognee \
26
+ && mkdir -p /app && chown cognee:cognee /app
27
+ USER cognee
28
+ WORKDIR /app
29
+
30
+ # Clone cognee at the pinned ref and install the MCP server's deps (as cognee).
31
+ RUN git clone https://github.com/topoteretes/cognee.git . \
32
+ && git checkout "$COGNEE_MCP_REF"
33
+ WORKDIR /app/cognee-mcp
34
+ RUN uv sync --all-extras
35
+
36
+ # Pre-create the persisted-storage root owned by cognee (uid 10001). A named
37
+ # volume mounted here inherits this ownership on first creation, so cognee can
38
+ # write ingested files/system data without a manual chown. DATA_ROOT_DIRECTORY /
39
+ # SYSTEM_ROOT_DIRECTORY (in .env) point under this path so data survives recreate.
40
+ RUN mkdir -p /app/cognee-mcp/.cognee_system
41
+
42
+ EXPOSE 7777
43
+
44
+ # HTTP transport has no plain GET health endpoint (the /mcp endpoint may 405 on
45
+ # GET), so liveness is a TCP connect check on the port.
46
+ HEALTHCHECK --interval=15s --timeout=5s --retries=5 --start-period=40s \
47
+ CMD python -c "import socket,sys; s=socket.create_connection(('127.0.0.1',7777),2); s.close()" || exit 1
48
+
49
+ # HTTP transport, all interfaces, port 7777, endpoint /mcp.
50
+ CMD ["uv", "run", "cognee-mcp", "--transport", "http", "--host", "0.0.0.0", "--port", "7777"]
@@ -0,0 +1,129 @@
1
+ # cognee-mcp — MISHKAN knowledge graph
2
+
3
+ Local Docker deployment of `cognee-mcp` — the MCP server that exposes the
4
+ [Cognee](https://docs.cognee.ai) knowledge graph to Claude Code (decision D-001).
5
+ Cognee core is a Python library; this container runs `cognee-mcp` in **HTTP
6
+ transport on port 7777** (endpoint `/mcp`). Optional: agents run without it; only
7
+ graph persistence is deferred until it's up.
8
+
9
+ New to Cognee setup? Run the **cognee-quickstart** skill first — it walks the
10
+ Python env, provider keys, and backend choices.
11
+
12
+ ## Bring it up
13
+
14
+ ```bash
15
+ cd ~/.claude/mishkan/cognee
16
+
17
+ # 1. secrets (SOPS-managed; never commit plaintext .env)
18
+ cp .env.example .env
19
+ # set LLM_API_KEY, set COGNEE_MCP_REF to a pinned cognee git tag/commit, decrypt via sops
20
+
21
+ # 2. build + start the WORK stack with the hardening overlay (always)
22
+ docker compose -f docker-compose.yml -f docker-compose.hardening.yml up -d --build
23
+
24
+ # 3. confirm it's listening on 7777
25
+ nc -z localhost 7777 && echo "cognee-mcp (work) up on :7777"
26
+
27
+ # 4. bring up the CURATED box (isolated reference library — decision D-007)
28
+ cp .env.curated.example .env.curated # fill secrets; create the DB once:
29
+ docker exec mishkan-cognee-pg psql -U cognee -d cognee_db -c "CREATE DATABASE curated_db OWNER cognee;"
30
+ docker compose --env-file .env.curated -f docker-compose.curated.yml up -d
31
+ nc -z localhost 7730 && echo "cognee-mcp (curated) up on :7730"
32
+
33
+ # 5. seed the curated reference library (96 nodes) INTO the curated box
34
+ ~/.claude/mishkan/scripts/seed-curated-library.sh # targets mishkan-curated-mcp
35
+ ```
36
+
37
+ ## Two stores (decision D-007)
38
+
39
+ | Store | Containers | Port | Holds | MCP alias |
40
+ |---|---|---|---|---|
41
+ | **work** | `mishkan-cognee-*` | 7777 | per-project knowledge + `<client>_memory` | `cognee` (read+write) |
42
+ | **curated** | `mishkan-curated-*` | 7730 | the cross-project reference library only | `cognee-curated` (read) |
43
+
44
+ The curated library is **physically isolated** in its own Neo4j so project data
45
+ (which can contain PII) never mixes with it. The curated box reuses the shared
46
+ Ollama and the shared Postgres *server* (own database `curated_db`). The
47
+ per-client memory dataset (e.g. `claude_code_memory`) is part of the **work**
48
+ store and must not be pruned.
49
+
50
+ ## How agents reach it
51
+
52
+ Claude Code connects via the project's `.mcp.json` (seeded by `/mishkan-init`
53
+ from `~/.claude/mishkan/templates/mcp.json`), which declares **both** stores:
54
+ `cognee` → work (`http://localhost:7777/mcp`) and `cognee-curated` → curated
55
+ (`http://localhost:7730/mcp`). A **zero-container stdio alternative** is included
56
+ in that template (`_stdio_alternative`): it launches `cognee-mcp` directly via
57
+ `uv --directory <path-to-cognee-mcp> run cognee-mcp` with `LLM_API_KEY` — no
58
+ container, no port. Use whichever fits.
59
+
60
+ ## Transports (per cognee docs)
61
+
62
+ | Transport | Command | Endpoint |
63
+ |---|---|---|
64
+ | stdio (default) | `uv run cognee-mcp` | — (Claude Code spawns it) |
65
+ | http | `uv run cognee-mcp --transport http --host 0.0.0.0 --port 7777` | `/mcp` |
66
+ | sse | `uv run cognee-mcp --transport sse --host 0.0.0.0 --port 7777` | `/sse` |
67
+
68
+ This deployment uses **http** on 7777.
69
+
70
+ ## Rules this deployment follows
71
+
72
+ - **Built locally** from a pinned `Dockerfile` (`COGNEE_MCP_REF` required) — no
73
+ blind image pull, no `:latest`.
74
+ - **SOPS/age** for the `.env` (`LLM_API_KEY` etc.); only an encrypted `.env.enc`
75
+ is committed.
76
+ - **Hardening overlay re-applied on every recreate** (`docker-compose.hardening.yml`):
77
+ `no-new-privileges`, `cap_drop: ALL`, tmpfs `/tmp`.
78
+ - **Healthcheck** = TCP connect on 7777 (HTTP `/mcp` may 405 on GET).
79
+ - **Bound to `127.0.0.1`** — not exposed beyond the host.
80
+ - **Resource limits** on the service.
81
+
82
+ ## Backends (self-hosted, swappable by env var)
83
+
84
+ Each layer defaults to local/embedded — zero extra services — swapped via one env
85
+ var (accepted values per the Cognee docs):
86
+
87
+ | Layer | Env var | Default | Options |
88
+ |---|---|---|---|
89
+ | Relational | `DB_PROVIDER` | `sqlite` | `sqlite`, `postgres` |
90
+ | Vector | `VECTOR_DB_PROVIDER` | `lancedb` | `lancedb`, `pgvector`, `qdrant`, `weaviate` |
91
+ | Graph | `GRAPH_DATABASE_PROVIDER` | `networkx` (file `.pkl`) | `networkx`, `kuzu`, `neo4j` |
92
+
93
+ Low-ops fit if you already run Postgres + pgvector: `DB_PROVIDER=postgres`,
94
+ `VECTOR_DB_PROVIDER=pgvector`, `GRAPH_DATABASE_PROVIDER=kuzu` (embedded, no server).
95
+
96
+ ## Visualising the graph
97
+
98
+ - **Static HTML (zero infra):** `visualize_graph("./graph.html")` from
99
+ `cognee.api.v1.visualize.visualize` writes an interactive HTML file (drag, zoom,
100
+ hover; color-coded nodes + weighted edges). Publish it as a Sefer artifact, e.g.
101
+ `docs/diagrams/graph.html`.
102
+ - **Cognee UI (Graph Explorer):** web workspace that visualises the *reasoning
103
+ subgraph* used to answer a query. Self-hosted via the optional
104
+ `docker-compose.ui.yml` overlay (profile `ui`) — see below.
105
+
106
+ ### Graph Explorer (UI) — optional overlay
107
+
108
+ The UI shows the graph **only if it shares a backend with `cognee-mcp`** (default
109
+ file backends are per-process silos). The overlay runs **Neo4j as the shared graph
110
+ backend** and points both `cognee-mcp` and the UI's cognee backend at it.
111
+
112
+ ```bash
113
+ # .env: GRAPH_DATABASE_PROVIDER=neo4j, GRAPH_DATABASE_URL=bolt://neo4j:7687,
114
+ # GRAPH_DB_USERNAME/PASSWORD (sops), COGNEE_SRC=/path/to/cloned/cognee
115
+ docker compose -f docker-compose.yml -f docker-compose.hardening.yml \
116
+ -f docker-compose.ui.yml --profile ui up -d --build
117
+ # UI http://localhost:7724 backend http://localhost:7737
118
+ # Neo4j http://localhost:7716 (Neo4j's own graph browser too)
119
+ ```
120
+
121
+ Ports are local-bound and configurable. The UI backend + frontend build from a
122
+ **cloned cognee repo** (`COGNEE_SRC`). The Cognee UI is "work in progress"
123
+ upstream — confirm build contexts and env keys against the docs and repo compose.
124
+
125
+ ## Data
126
+
127
+ - `cognee_data` — Docker-managed volume (cognee's local graph/vector/sqlite when
128
+ using default backends). Runtime state, not shipped with the harness.
129
+ - `curated-resources.jsonl` — produced by the seed script; runtime output.
@@ -0,0 +1,61 @@
1
+ # MISHKAN — CURATED Graph Explorer UI (optional overlay).
2
+ # A separate Cognee backend + frontend bound to the CURATED graph, so the
3
+ # curated reference library has its own Explorer — distinct from the work UI
4
+ # (:7724), which only sees the work store. Reuses the already-built UI images.
5
+ #
6
+ # docker compose --env-file .env.curated \
7
+ # -f docker-compose.curated.yml -f docker-compose.curated-ui.yml up -d
8
+ #
9
+ # UI → http://localhost:7734 (frontend) → http://localhost:7733 (backend) →
10
+ # curated Neo4j. Both 127.0.0.1-bound; tunnel 7733+7734 to view.
11
+
12
+ services:
13
+ curated-backend:
14
+ image: mishkan/cognee-backend:${COGNEE_MCP_REF:?}
15
+ container_name: mishkan-curated-backend
16
+ restart: unless-stopped
17
+ depends_on:
18
+ curated-neo4j:
19
+ condition: service_healthy
20
+ env_file:
21
+ - .env.curated # same curated config → curated graph
22
+ environment:
23
+ HOST: 0.0.0.0
24
+ ENVIRONMENT: local
25
+ CORS_ALLOWED_ORIGINS: ${CURATED_CORS:-http://localhost:${CURATED_UI_PORT:-7734}}
26
+ ports:
27
+ - "127.0.0.1:${CURATED_BACKEND_PORT:-7733}:8000"
28
+ networks:
29
+ - shared
30
+ security_opt:
31
+ - no-new-privileges:true
32
+ deploy:
33
+ resources:
34
+ limits:
35
+ cpus: "2.0"
36
+ memory: 3g
37
+
38
+ curated-frontend:
39
+ image: mishkan/cognee-frontend:${COGNEE_MCP_REF:?}
40
+ container_name: mishkan-curated-frontend
41
+ restart: unless-stopped
42
+ depends_on:
43
+ - curated-backend
44
+ environment:
45
+ NEXT_PUBLIC_LOCAL_API_URL: ${CURATED_NEXT_PUBLIC_API_URL:-http://localhost:${CURATED_BACKEND_PORT:-7733}}
46
+ ports:
47
+ - "127.0.0.1:${CURATED_UI_PORT:-7734}:3000"
48
+ networks:
49
+ - shared
50
+ security_opt:
51
+ - no-new-privileges:true
52
+ deploy:
53
+ resources:
54
+ limits:
55
+ cpus: "1.0"
56
+ memory: 1g
57
+
58
+ networks:
59
+ shared:
60
+ external: true
61
+ name: ${COGNEE_WORK_NETWORK:-mishkan-cognee_cognee_net}
@@ -0,0 +1,85 @@
1
+ # MISHKAN — CURATED box: isolated reference-library store, physically separate
2
+ # from the work/project graph. Holds ONLY the curated_library reference nodes.
3
+ # Own Neo4j (the isolation point) + reuses the SHARED Ollama and the SHARED
4
+ # Postgres server (own database: curated_db). No UI — it is static, read-mostly
5
+ # reference; query via MCP, browse via Neo4j Browser on the curated http port.
6
+ #
7
+ # docker compose --env-file .env.curated -f docker-compose.curated.yml up -d
8
+ #
9
+ # Why a separate box: project knowledge (decisions, incidents, ingested code —
10
+ # which can include PII) must never mix with the cross-project curated library.
11
+ # Neo4j Community allows only one database per instance, so physical graph
12
+ # isolation = a separate Neo4j container. See decision D-007.
13
+ #
14
+ # Joins the work-stack network so it can reach `ollama` and `postgres` by their
15
+ # aliases. Bring the work stack up first (it owns the network). The work network
16
+ # name defaults to the compose project name + "_cognee_net"; override via
17
+ # COGNEE_WORK_NETWORK in .env.curated if your work stack uses a different name.
18
+
19
+ services:
20
+ curated-neo4j:
21
+ image: neo4j:5.26
22
+ container_name: mishkan-curated-neo4j
23
+ restart: unless-stopped
24
+ environment:
25
+ NEO4J_AUTH: ${GRAPH_DATABASE_USERNAME:?}/${GRAPH_DATABASE_PASSWORD:?}
26
+ NEO4J_PLUGINS: '["apoc"]'
27
+ NEO4J_dbms_security_procedures_unrestricted: "apoc.*"
28
+ NEO4J_dbms_security_procedures_allowlist: "apoc.*"
29
+ ports:
30
+ - "127.0.0.1:${CURATED_NEO4J_HTTP_PORT:-7731}:7474"
31
+ - "127.0.0.1:${CURATED_NEO4J_BOLT_PORT:-7732}:7687"
32
+ volumes:
33
+ - curated_neo4j_data:/data
34
+ healthcheck:
35
+ test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:7474 >/dev/null 2>&1 || exit 1"]
36
+ interval: 15s
37
+ timeout: 5s
38
+ retries: 5
39
+ start_period: 30s
40
+ networks:
41
+ - shared
42
+ security_opt:
43
+ - no-new-privileges:true
44
+ deploy:
45
+ resources:
46
+ limits:
47
+ cpus: "1.0"
48
+ memory: 2g
49
+
50
+ curated-mcp:
51
+ image: mishkan/cognee-mcp:${COGNEE_MCP_REF:?}
52
+ container_name: mishkan-curated-mcp
53
+ restart: unless-stopped
54
+ depends_on:
55
+ curated-neo4j:
56
+ condition: service_healthy
57
+ env_file:
58
+ - .env.curated
59
+ ports:
60
+ - "127.0.0.1:${CURATED_MCP_PORT:-7730}:7777"
61
+ healthcheck:
62
+ test: ["CMD-SHELL", "python3 -c \"import socket; socket.create_connection(('127.0.0.1',7777),2).close()\" || exit 1"]
63
+ interval: 15s
64
+ timeout: 5s
65
+ retries: 10
66
+ start_period: 90s
67
+ networks:
68
+ - shared
69
+ security_opt:
70
+ - no-new-privileges:true
71
+ tmpfs:
72
+ - /tmp
73
+ deploy:
74
+ resources:
75
+ limits:
76
+ cpus: "2.0"
77
+ memory: 3g
78
+
79
+ networks:
80
+ shared:
81
+ external: true
82
+ name: ${COGNEE_WORK_NETWORK:-mishkan-cognee_cognee_net}
83
+
84
+ volumes:
85
+ curated_neo4j_data:
@@ -0,0 +1,16 @@
1
+ # MISHKAN — cognee-mcp hardening overlay (Migdal rule: re-applied on EVERY recreate).
2
+ # Usage: docker compose -f docker-compose.yml -f docker-compose.hardening.yml up -d
3
+ #
4
+ # Forbids privilege escalation and drops all Linux capabilities. The root fs is
5
+ # left writable because uv/python write caches at runtime; /tmp is tmpfs. Tighten
6
+ # further per the CIS Docker Benchmark once the runtime write paths are confirmed.
7
+
8
+ services:
9
+ cognee-mcp:
10
+ security_opt:
11
+ - no-new-privileges:true
12
+ cap_drop:
13
+ - ALL
14
+ tmpfs:
15
+ - /tmp
16
+ # cognee_data volume remains writable (declared in base compose).
@@ -0,0 +1,114 @@
1
+ # MISHKAN — Cognee FULLY SELF-HOSTED overlay (no external LLM/API).
2
+ # Local Ollama (LLM + embeddings) + SHARED server backends (Neo4j graph,
3
+ # Postgres/pgvector relational+vector) so cognee-mcp (agents) and the Graph
4
+ # Explorer UI both read/write the SAME graph. Nothing leaves the host.
5
+ #
6
+ # docker compose -f docker-compose.yml -f docker-compose.hardening.yml \
7
+ # -f docker-compose.selfhosted.yml up -d --build
8
+ #
9
+ # All cognee config (LLM/embedding/graph/relational/vector) lives in .env so both
10
+ # cognee-mcp and the UI backend share it. Var names per cognee v1.1.0 .env.template.
11
+ # The only credentials are two SELF-CHOSEN LOCAL passwords (Neo4j, Postgres) —
12
+ # no external API keys. SOPS-manage .env.
13
+ #
14
+ # Models (pull once into the ollama volume):
15
+ # ollama pull nomic-embed-text # embeddings, 768 dims
16
+ # ollama pull llama3.2:3b # LLM (light; LLM_MODEL swappable, e.g. llama3.1:8b)
17
+
18
+ services:
19
+ ollama:
20
+ image: ollama/ollama:${OLLAMA_VERSION:?set OLLAMA_VERSION in .env to a pinned tag}
21
+ container_name: mishkan-ollama
22
+ restart: unless-stopped
23
+ volumes:
24
+ - ollama_models:/root/.ollama
25
+ expose:
26
+ - "11434"
27
+ healthcheck:
28
+ test: ["CMD", "sh", "-c", "ollama list >/dev/null 2>&1 || exit 1"]
29
+ interval: 15s
30
+ timeout: 5s
31
+ retries: 5
32
+ start_period: 20s
33
+ networks:
34
+ - cognee_net
35
+ security_opt:
36
+ - no-new-privileges:true
37
+ deploy:
38
+ resources:
39
+ limits:
40
+ cpus: "4.0"
41
+ memory: 10g
42
+
43
+ neo4j:
44
+ image: neo4j:5.26
45
+ container_name: mishkan-cognee-neo4j
46
+ restart: unless-stopped
47
+ environment:
48
+ NEO4J_AUTH: ${GRAPH_DATABASE_USERNAME:?}/${GRAPH_DATABASE_PASSWORD:?}
49
+ # Cognee's Neo4j adapter calls APOC (apoc.create.addLabels, etc.). The
50
+ # apoc-core jar ships inside the neo4j:5.26 image (/var/lib/neo4j/labs),
51
+ # so NEO4J_PLUGINS just activates it locally — no download needed.
52
+ NEO4J_PLUGINS: '["apoc"]'
53
+ NEO4J_dbms_security_procedures_unrestricted: "apoc.*"
54
+ NEO4J_dbms_security_procedures_allowlist: "apoc.*"
55
+ ports:
56
+ - "127.0.0.1:${NEO4J_HTTP_PORT:-7716}:7474" # Neo4j Browser
57
+ - "127.0.0.1:${NEO4J_BOLT_PORT:-7709}:7687" # bolt
58
+ volumes:
59
+ - neo4j_data:/data
60
+ healthcheck:
61
+ test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:7474 >/dev/null 2>&1 || exit 1"]
62
+ interval: 15s
63
+ timeout: 5s
64
+ retries: 5
65
+ start_period: 30s
66
+ networks:
67
+ - cognee_net
68
+ security_opt:
69
+ - no-new-privileges:true
70
+ deploy:
71
+ resources:
72
+ limits:
73
+ cpus: "1.5"
74
+ memory: 2g
75
+
76
+ postgres:
77
+ image: pgvector/pgvector:pg16
78
+ container_name: mishkan-cognee-pg
79
+ restart: unless-stopped
80
+ environment:
81
+ POSTGRES_DB: ${DB_NAME:?}
82
+ POSTGRES_USER: ${DB_USERNAME:?}
83
+ POSTGRES_PASSWORD: ${DB_PASSWORD:?}
84
+ volumes:
85
+ - cognee_pgdata:/var/lib/postgresql/data
86
+ healthcheck:
87
+ test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}"]
88
+ interval: 10s
89
+ timeout: 5s
90
+ retries: 5
91
+ start_period: 20s
92
+ networks:
93
+ - cognee_net
94
+ security_opt:
95
+ - no-new-privileges:true
96
+ deploy:
97
+ resources:
98
+ limits:
99
+ cpus: "1.0"
100
+ memory: 1g
101
+
102
+ cognee-mcp:
103
+ depends_on:
104
+ ollama:
105
+ condition: service_healthy
106
+ neo4j:
107
+ condition: service_healthy
108
+ postgres:
109
+ condition: service_healthy
110
+
111
+ volumes:
112
+ ollama_models:
113
+ neo4j_data:
114
+ cognee_pgdata: