Skip to content

Commit 3e166b7

Browse files
Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts: # tests/e2e/graph-engine.spec.js # tests/test_graph_engine_asset.py
2 parents 7bc7746 + 1b084f1 commit 3e166b7

67 files changed

Lines changed: 10624 additions & 520 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
31+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
3232
with:
3333
languages: ${{ matrix.language }}
3434
build-mode: none
3535
config-file: ./.github/codeql/codeql-config.yml
3636
- name: Analyze
3737
id: analyze
38-
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
38+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
3939
with:
4040
output: codeql-results
4141
- name: Require clean CodeQL results

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,14 @@ jobs:
678678
with:
679679
python-version: "3.11"
680680
- name: Initialize CodeQL
681-
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
681+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
682682
with:
683683
languages: ${{ matrix.language }}
684684
build-mode: none
685685
config-file: ./.github/codeql/codeql-config.yml
686686
- name: Analyze complete source tree
687687
id: analyze
688-
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
688+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
689689
with:
690690
output: codeql-results
691691
upload: never

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ uv.lock
138138
# mixed-case variants from slipping through on case-insensitive machines.
139139
/[Pp][Rr][Oo][Mm][Pp][Tt]_[Ss][Ee][Ss][Ss][Ii][Oo][Nn]_[Tt][Rr][Aa][Nn][Ss][Cc][Rr][Ii][Pp][Tt]_[Aa][Nn][Aa][Ll][Yy][Ss][Ii][Ss].md
140140
/[Ss][Ee][Ss][Ss][Ii][Oo][Nn]_[Tt][Rr][Aa][Nn][Ss][Cc][Rr][Ii][Pp][Tt]_[Qq][Uu][Ee][Rr][Yy]_[Pp][Rr][Oo][Mm][Pp][Tt].md
141+
142+
# Command Code per-session scratchpad (agent working files, never package content).
143+
/$COMMANDCODE_SCRATCHPAD/

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and pluggable.
99
This is the canonical operating manual for any AI agent working in this repo. `CLAUDE.md`
1010
imports it. Read §0 before editing anything.
1111

12+
### Internal subagent delegation
13+
14+
When parallel delegation is appropriate for ChatGPT/Codex tasks, use exactly four bounded
15+
subagents inside the current task and chat. Keep delegation at one level: workers return bounded
16+
results and the parent performs the sole integration. Subagents must never be sent to Orca, Orca
17+
orchestration, or separate user-visible threads. Before finalizing, verify that all four workers
18+
returned and that no forbidden routing or descendant delegation occurred.
19+
1220
---
1321

1422
## 0. Read this first — two architectures live in one package

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,26 @@ All notable changes to Engraphis are documented here. Format loosely follows
184184
- Folder imports report truncation explicitly: a folder with more matching files than the
185185
ceiling now warns and returns `truncated`/`matched_total`/`unreadable` fields instead of
186186
silently importing an alphabetically-first slice that looks complete.
187+
- The `engraphis_prime_agent` integration now ships a fleet wrapper that boots multiple
188+
sub-agents (researcher / coder / reviewer / writer) with one shared memory workspace,
189+
with fleet-wide configuration via `ENGRAPHIS_REPO` and per-agent override via the
190+
`repo=` argument; the `engraphis-prime-agent install` subcommand configures a target
191+
prime-agent configuration file and `python -m engraphis_prime_agent install`
192+
works directly from the installed wheel.
187193

188194
### Fixed
189195

190196
- The Every node dashboard view no longer crashes on open: a declaration-order bug in the
191197
renderer threw during construction before anything painted. The scene canvas also keeps its
192198
accessible role/label now instead of being hidden from assistive technology.
199+
- Prompt-only recall now honours an opt-in `ENGRAPHIS_RECALL_ARM_CANDIDATE_K` env var (and
200+
the matching `RecallEngine(arm_candidate_k_cap=...)` constructor argument) that clamps both
201+
the first-page widening (`candidate_k + min(250, candidate_k*3)`) and the second-page
202+
ceiling, so operators can trade untrusted-scope widening for latency on the new k=50
203+
default without code changes. The accompanying benchmark test,
204+
`test_recall_arm_candidate_k_cap.py`, uses a 300-fact trusted corpus because both requested
205+
arm depths clamp to the same 49 rows on a smaller corpus and the timing assertion was
206+
unreliable. Default behaviour is unchanged.
193207
- Import previews now page the source manifest exactly like execution, so vaults whose manifest
194208
outgrew one list page (10k identities) no longer show manifest-only files as silently absent
195209
from the preview plan; beyond-boundary rows are reported as `missing` instead of dropped.

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,51 @@ including `engraphis_check_update`, is in the [MCP tool reference](https://githu
396396
For installation, configuration, lifecycle commands, and the local trust boundary, see the
397397
[Pi extension guide](https://github.com/Coding-Dev-Tools/engraphis/blob/main/integrations/pi/README.md).
398398

399+
### Command Code SessionStart hook
400+
401+
`integrations/commandcode/` ships a SessionStart hook that warms up a new
402+
session with bounded, recalled context from the local Engraphis gateway. Fails
403+
open on timeout and is installed via `python scripts/install_cc_hook.py`.
404+
405+
### prime-agent fleet
406+
407+
`integrations/prime_agent/` ships a first-party Python package for
408+
[PrimeIntellect prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)
409+
that exposes the same nine Smart MCP tools, with a `PrimeAgentFleet` of eight
410+
named sub-agents (`researcher`, `planner`, `coder`, `reviewer`, `tester`,
411+
`documenter`, `monitor`, `integrator`) sharing one `engraphis-mcp` stdio
412+
subprocess. Install via `pip install ./integrations/prime_agent` and register
413+
with `python scripts/install_prime_agent.py`. See the
414+
[prime-agent integration guide](https://github.com/Coding-Dev-Tools/engraphis/blob/main/integrations/prime_agent/README.md).
415+
416+
**What the integration is.** A `PrimeAgentFleet` is a thin Python layer
417+
around the same `engraphis-mcp` Smart gateway every other host uses. At
418+
runtime the fleet holds one shared `EngraphisMcpClient`, which owns one
419+
`engraphis-mcp` subprocess over JSON-RPC stdio. Each of the eight named
420+
sub-agents gets its own Engraphis session (started lazily on first tool use)
421+
and its own default `repo` scope, so per-role memory is isolated while the
422+
local gateway stays single-process. The eight sub-agent names
423+
(`researcher`, `planner`, `coder`, `reviewer`, `tester`, `documenter`,
424+
`monitor`, `integrator`) are the fixed default; pass `agent_names=[...]` to
425+
`PrimeAgentFleet(...)` for a custom set. Concurrent tool calls serialize at
426+
the JSON-RPC frame layer through an `asyncio.Lock`, so framework-level
427+
parallelism (eight sub-agents reasoning at once) is preserved while the
428+
underlying MCP transport remains one ordered stream. The only integration
429+
surface is `EngraphisPrimeAgent.register()` in
430+
`integrations/prime_agent/src/engraphis_prime_agent/agent.py` -- that is the
431+
single adapter point to override if prime-agent's tool-registration API
432+
differs from the assumed `target.register_tool(name, fn, schema=...)`
433+
contract.
434+
435+
The design -- eight named sub-agents, one shared stdio subprocess,
436+
per-agent session bootstrap, and `ENGRAPHIS_*`-only environment forwarding
437+
to the gateway -- is recorded in `~/.commandcode/plans/prime-agent-integration.md`
438+
on the host where the integration was developed. When that host plan is not
439+
available (other contributor machines, CI), the same design is summarized in
440+
the PR description that introduced the integration and in the
441+
[prime-agent integration guide](https://github.com/Coding-Dev-Tools/engraphis/blob/main/integrations/prime_agent/README.md)
442+
("Architecture" and "Concurrency model" sections).
443+
399444
## Quickstart: repository graph
400445

401446
```bash
@@ -721,8 +766,8 @@ file. It never searches the working directory for `.env`, and explicit process v
721766
| `ENGRAPHIS_ALLOW_AUTOMATIC_CRITICAL_RETENTION` | `false` | Opt in only when an LLM supervisor may automatically assign the long-lived `critical` class; explicit user-selected critical retention is unaffected |
722767
| `ENGRAPHIS_WHISPER_MODEL` | Not set | Enables local faster-whisper audio/video transcription |
723768
| `ENGRAPHIS_POSTGRES_DSN` | Not set | CLI-only PostgreSQL source; used for the connection and never stored |
724-
| `ENGRAPHIS_POSTGRES_CONNECT_TIMEOUT` | `10` | PostgreSQL introspection connection timeout in seconds (bounded to 1120) |
725-
| `ENGRAPHIS_POSTGRES_STATEMENT_TIMEOUT_MS` | `30000` | Per-introspection PostgreSQL statement timeout in milliseconds (bounded to 1300000) |
769+
| `ENGRAPHIS_POSTGRES_CONNECT_TIMEOUT` | `10` | PostgreSQL introspection connection timeout in seconds (bounded to 1--120) |
770+
| `ENGRAPHIS_POSTGRES_STATEMENT_TIMEOUT_MS` | `30000` | Per-introspection PostgreSQL statement timeout in milliseconds (bounded to 1--300000) |
726771
| `ENGRAPHIS_GRAPH_TOKEN` | Not set | Bearer token for `engraphis-graph-server`; required off-loopback |
727772
| `ENGRAPHIS_GRAPH_HOST` / `ENGRAPHIS_GRAPH_PORT` | `127.0.0.1` / `8720` | Read-only graph/recall server bind address |
728773
| `ENGRAPHIS_LLM_PROVIDER` | `openai` | `openai \| anthropic \| google \| openrouter \| custom` |
@@ -743,10 +788,20 @@ file. It never searches the working directory for `.env`, and explicit process v
743788
| `ENGRAPHIS_CLOUD_ACCESS_TOKEN` | Not set | Optional short-lived access token for ephemeral jobs |
744789
| `ENGRAPHIS_MANAGED_COMPUTE_CONSENT` | *(auto)* | Operator override only; default follows whether a cloud session is configured (connected = allowed, local-only = never). `0` opts a connected installation out; `1` permits local snapshot preparation but does not create a cloud credential or authorize an upload |
745790

791+
The optional cross-encoder reranker is model- and hardware-dependent. Treat its quality and
792+
latency as deployment-specific until a versioned model identity, exact configuration, and
793+
reproducible evaluation artifact are available for the comparison being reported.
794+
746795
See `.env.example` for the full variable inventory. Supply those values through the process
747796
environment or the trusted config file above; copying it to an arbitrary `./.env` does not make
748797
Engraphis load it.
749798

799+
> **Ablation fixture:** `python -m eval.ablation` is an offline deterministic check that prints
800+
> `recall@5` comparisons for vector-only and hybrid retrieval, multi-hop graph arms, and
801+
> retrieval policies, plus ordinary-recall age and semantic-confidence checks. It does not
802+
> produce MRR, hit@5, or ms/query results. Use `python -m eval.reinforcement` for retention
803+
> trajectories, and register evidence before quoting any benchmark results.
804+
750805
---
751806

752807
## Project structure

docs/LLM_PROVIDERS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ server, replacing the path with the one from initialization:
223223
cmd mcp add --scope local --env ENGRAPHIS_DB_PATH=/absolute/path/to/engraphis.db engraphis -- engraphis-mcp
224224
```
225225

226+
Windows: `cmd` may resolve to `cmd.exe` (the built-in Windows command interpreter)
227+
instead of the Command Code CLI. If `cmd mcp list` opens a Windows command-prompt window or
228+
prints `'mcp' is not recognized`, the wrong `cmd` was found on `PATH`. Run `where cmd` and
229+
ensure the Command Code CLI's install directory appears before `C:\Windows\System32`;
230+
otherwise invoke the CLI by its absolute path (e.g.
231+
`C:\Users\you\AppData\Roaming\Python\Scripts\cmd.exe`).
232+
226233
All Command Code options precede the server name, and `--` separates the name from the stdio
227234
command. `engraphis-mcp` runs locally over stdio; normal local use needs no HTTP endpoint or
228235
Engraphis API key.
@@ -244,6 +251,9 @@ cmd mcp list
244251
cmd mcp get engraphis
245252
```
246253

254+
(If these commands open a Windows command prompt instead of listing MCP servers, follow the
255+
Windows note above -- `cmd` resolved to `cmd.exe`.)
256+
247257
Start a normal Command Code session with `cmd`, open `/mcp`, and confirm that `engraphis` is
248258
connected and exposes tools. Then ask Command Code: "Call `engraphis_stats` and show me the
249259
result." A response with memory counts confirms the end-to-end connection.
381 KB
Loading

0 commit comments

Comments
 (0)