archgraph-argo 0.26.2 → 0.28.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.
package/README.md CHANGED
@@ -1,97 +1,167 @@
1
1
  # ArchGraph
2
2
 
3
- An architecture-graph driven framework for Agentic Engineering.
3
+ **A knowledge-graph framework with an ontology you define — wired into your coding agent through one MCP interface.**
4
+
5
+ For teams running coding agents on a real codebase, ArchGraph gives the agent durable, tiered long-term memory on an **intent graph** — a versioned architecture graph that records *why* the system is built the way it is, not just how. You and the agent read and write it through a single **MCP** server (**MCP** = **Model Context Protocol**, the open standard that lets an AI tool call external servers as tools). The graph's shape is set by an **ontology** — its vocabulary of element and relationship types — and that ontology is yours to define. The built-in default is **ArchiMate 3.2 + ARGO extensions**, where **ArchiMate** is a standard enterprise-architecture modeling language and **ARGO** is the toolchain and agent-workflow layer behind the `argo-deploy` and `argo init` commands. A repository can plug in its own ontology — and this one does. **One install, one interface to learn.**
6
+
7
+ Ready to try it? Jump to **[Build your own graph](#build-your-own-graph)**.
8
+
9
+ [Install](#install) · [Build your own graph](#build-your-own-graph) · [Why ArchGraph](#why-archgraph) · [Capabilities](#capabilities) · [Docs](#docs) · [Community](#community)
10
+
11
+ ![ArchGraph core model — one graph for the agent's memory and the product's design](docs/diagrams/core-model.svg)
4
12
 
5
13
  ## What is this?
6
14
 
7
- ArchGraph builds a **unified language** that puts harness design and target product design into
8
- **one model** — so you get a single view to work and observe, and real control over your agents.
15
+ If you run coding agents on a real codebase, every session starts cold and the "why" behind the system lives nowhere. ArchGraph makes **one architecture graph** the single source of truth — the agent's memory and the product's design in one model. It is *one MCP interface* to install and learn: the agent restores context at session start, recalls detail on demand, and reuses what it already knows instead of duplicating it (a duplicate needs an explicit override).
9
16
 
10
- It doubles as a **long-term memory for coding agents**: an ArchiMate 3.2 intent graph exposed through
11
- a single read/write MCP interface. Writes are deduplicated, so the graph stays clean and semantic
12
- recall stays precise. See the [home page](https://archgraph.org/) for the full capability set.
17
+ - **Architects / tech leads** — one model of the product, the harness, and the agents.
18
+ - **Agent users** — memory restored at session start, recalled on demand, reused instead of duplicated.
19
+ - **Platform teams** — one interface, deployed into the editor you already use.
13
20
 
14
- ![alt text](docs/diagrams/image.png)
21
+ → Full onboarding: **[docs/getting-started.html](docs/getting-started.html)**
15
22
 
16
- ## Architecture
23
+ ## Why ArchGraph
17
24
 
18
- The global architecture (Layered Viewpoint) shows how the human, the coding agent, ARGO MCP, the
19
- intent architecture graph, ArchiMate 3.2, and Enterprise Architect relate in graph-driven agentic
20
- engineering:
25
+ Every team running coding agents hits the same wall: the code is in the repo, but the *reasoning* behind it lives nowhere. Four common fixes exist, and each works until it doesn't.
21
26
 
22
- ![Global architecture — Layered Viewpoint](docs/diagrams/global-architecture.svg)
27
+ The real differentiator is **not** "custom vs. locked". Protégé/OWL, Neo4j, TerminusDB, and Archi/EA all let you extend a model or bring your own vocabulary. It is that ArchGraph makes the ontology a **first-class, validated, runtime-resolved schema bundle** — and puts it behind **one MCP interface** the agent reads *and* writes, with typed dedup and commit traceability built in.
23
28
 
24
- Editable source: [`docs/diagrams/global-architecture.excalidraw`](docs/diagrams/global-architecture.excalidraw)
29
+ The honest, cost-included comparison lives in one canonical place — **[docs/capabilities.html#compare](docs/capabilities.html#compare)**.
25
30
 
26
- ## Supported Harnesses
31
+ ## Bring your own ontology
27
32
 
28
- ArchGraph deploys the ARGO toolchain to all major coding-agent environments:
33
+ A knowledge-graph framework that speaks only one language is not a framework. ArchGraph separates the **core** from the **ontology**: a repository drops a *schema bundle* under `.argo/schema/` (element/relationship types, endpoint rules, an actor contract, an optional guide), and validation, MCP guidance, and the `.qea` projection follow it. A bundle can `extends: "default"` — inheriting the built-in **ArchiMate 3.2 + ARGO extensions** — and add its own types; no framework change required.
29
34
 
30
- | Harness | MCP Server | Skills | Rules / Instructions | Agents | Wakeup Gate |
31
- |--------------------|:----------:|:------:|:--------------------:|:------:|:-----------:|
32
- | GitHub Copilot | ✓ | ✓ | ✓ | ✓ | — |
33
- | Cursor | ✓ | ✓ | ✓ | ✓ | — |
34
- | OpenCode | ✓ | ✓ | ✓ | ✓ | ✓ |
35
- | DeepSeek Harness | ✓ | ✓ | ✓ | ✓ | ✓ |
36
- | OpenClaw | ✓ | ✓ | ✓ | — | ✓ |
35
+ This repository is the proof: its own bundle uses `extends: "default"` and layers a **UML 2 state-machine profile** on top, resolved at runtime from `.argo/schema/` rather than hardcoded in the framework.
37
36
 
38
- A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness
39
- automatically.
37
+ → Worked example — define an ontology, then build the graph step by step: **[docs/case-team-graph.html](docs/case-team-graph.html)** · runnable bundle: [`custom-schema/`](custom-schema/README.md)
40
38
 
41
39
  ## Install
42
40
 
43
- ```powershell
41
+ **Prerequisite: Node.js ≥ 18** (the ARGO toolchain and the MCP server both run on Node).
42
+
43
+ ```bash
44
44
  npm install -g archgraph-argo
45
45
  argo-deploy
46
46
  ```
47
47
 
48
- Done — the ARGO toolchain, skills, and rules are deployed, and the `argo` MCP server is registered automatically in **GitHub Copilot**, **Cursor**, **OpenCode**, **DeepSeek Harness** (dsh), and **OpenClaw**.
48
+ `argo-deploy` registers the `argo` MCP server and installs the skills and rules into **GitHub Copilot, Cursor, OpenCode, DeepSeek Harness, OpenClaw, and Codex** (agents are installed where the host supports them). It then prompts for the few settings in `~/.argo/.env`. **After deploying, restart your editor / host** so it reloads the MCP server. Semantic queries additionally need **Neo4j** and an **embedding** endpoint — see [Build your own graph](#build-your-own-graph).
49
49
 
50
- ### Prerequisites and configuration
50
+ ## Quick start
51
51
 
52
- Everything works out of the box except **semantic (Graph RAG) queries**, which need:
52
+ There is **one** canonical start: **[Build your own graph](#build-your-own-graph)** — install once, then pick Route A (the default ontology) or Route B (your own). That section carries every step and MCP call; this one deliberately keeps no second copy, so there is only one path to follow.
53
53
 
54
- - **Neo4j graph database** — stores the structural projection of your architecture graph. During
55
- `argo-deploy` you configure `ARGO_NEO4J_DATABASE_URL`, `ARGO_NEO4J_DATABASE_USERNAME`, and
56
- `ARGO_NEO4J_DATABASE_PASSWORD` in `~/.argo/.env`.
57
- - **Embedding / vector engine** — powers semantic Graph RAG retrieval. Configure
58
- `ARGO_EMBEDDING_BASE_URL`, `ARGO_EMBEDDING_MODEL`, `ARGO_EMBEDDING_PROVIDER`,
59
- `ARGO_EMBEDDING_MODEL_VERSION`, `ARGO_EMBEDDING_DIMENSIONS`, plus the API key `QWEN_KEY`.
60
- It points at **any OpenAI-compatible embedding endpoint** — a cloud provider, or a self-hosted
61
- server for offline / intranet / private deployments via `ARGO_EMBEDDING_PROFILE=openai-compatible`
62
- (see the [self-hosted embedding guide](docs/self-hosted-embedding-deployment.md)).
54
+ **The one prerequisite that is not out of the box:** semantic (Graph RAG) retrieval needs a **Neo4j** instance and an OpenAI-compatible **embedding** endpoint. Context reads, writes, and Enterprise Architect interop work without them; the **Cypher** (Neo4j's graph query language) structural projection and all semantic retrieval need Neo4j.
63
55
 
64
- Where do the values come from? The Neo4j credentials come from the Neo4j instance you own or
65
- provision (URI, username, password). The embedding configuration and `QWEN_KEY` come from your
66
- embedding provider's dashboard — for example Alibaba DashScope — or from a self-hosted
67
- OpenAI-compatible server. `argo-deploy` walks you through the prompt (existing non-empty values in
68
- `~/.argo/.env` are kept); you can also edit the file afterwards and re-run.
56
+ ## Build your own graph
69
57
 
70
- ## How to use
58
+ Pick **one** of two routes. Everything happens through your coding agent and the ARGO MCP server; the only commands you run yourself are the install. Once initialized, the intent graph is the single source of truth.
59
+
60
+ ### Route A — default ontology (fastest)
61
+
62
+ No schema work: use the built-in **ArchiMate 3.2 + ARGO extensions**.
63
+
64
+ 1. **Install (once).** Requires **Node.js ≥ 18**.
65
+
66
+ ```bash
67
+ npm install -g archgraph-argo
68
+ argo-deploy
69
+ ```
70
+
71
+ Then **restart your editor / host** so it reloads the MCP server.
72
+
73
+ 2. **Initialize.** Ask your coding agent to run `argo init` (the `initializeWorkspace` MCP call). It creates and validates the starter `design/KG/SystemArchitecture.json`, which already contains the project's root view named `SystemArchitecture`.
74
+
75
+ 3. **Add elements and relationships.** Ask your coding agent to call `applySystemArchitectureMutation` and attach every new element and relationship to the project's **existing root view** — tell it to resolve that view's real `view_id` first (`queryNeo4jGraph` / `getArchitectureViewContext`). Do **not** pre-create a view: a new view called `SystemArchitecture` would collide with the one `argo init` made, and any `view_ids` pointing at a different id would then fail.
76
+
77
+ 4. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}` to confirm the element and relationship types in effect.
78
+
79
+ ### Route B — your own ontology
80
+
81
+ 1. **Install (once).** As in Route A.
82
+
83
+ 2. **Author your schema.** Put your modeling language under `.argo/schema/`. A **standalone** bundle — a full `SystemArchitecture.schema.json`, editing its two `$defs` enum arrays, `archimateElementType` and `archimateRelationshipType` — **must also declare `actorElementType` in `schema-bundle.config.json`**, set to one of your element types (or to `null` if your schema genuinely has no actor concept), or loading fails closed (`bundleValidation.status: "failed"`) and validation/writes are blocked. A bundle that only `extends: "default"` needs just the config. `schema-bundle.rules.json` stays optional (without it, endpoint checks are permissive).
84
+
85
+ 3. **Author the graph yourself.** With a custom schema, `argo init` does **not** create the graph — the packaged default would not match your vocabulary — and it **fails closed** with `NO_DEFAULT_GRAPH`. Before any MCP write, create `design/KG/SystemArchitecture.json` by hand, using your own element and relationship types and your own root view. Then ask your coding agent to run `argo init` to validate it.
86
+
87
+ 4. **Add into YOUR root view.** Ask your coding agent to call `applySystemArchitectureMutation`, attaching each element and relationship to the root view **you authored** (not the default one).
71
88
 
72
- **Step 0 — initialize the workspace.** In a fresh project, ask your coding agent to run `argo init`
73
- (the `initializeWorkspace` MCP call). It creates a starter `design/KG/SystemArchitecture.json` when
74
- missing, performs the first JSON → Neo4j sync, initializes the semantic (Graph RAG) lifecycle, and
75
- verifies the architecture. From then on, the intent graph is the source of truth for the project.
89
+ 5. **Verify.** Ask your coding agent to call `validateSystemArchitecture`, then `queryNeo4jGraph` with `{"schema": true}`.
76
90
 
77
- After installing, open your project and start a coding agent. It will:
91
+ The fully-illustrated, step-by-step walkthrough is **[docs/case-team-graph.html](docs/case-team-graph.html)** (Chinese), and the runnable example bundle is [`custom-schema/`](custom-schema/README.md). The result looks like this:
92
+
93
+ ![Team Graph example — Agent 001 assigned to Team A, Team A depends on Service A, Service A depends on Service B](docs/diagrams/team-graph-elements-relations.svg)
94
+
95
+ ## Capabilities
96
+
97
+ Each line links to a short page — this is the map, not the manual.
98
+
99
+ - **[Tiered long-term memory](docs/capabilities.html#memory)** — a compact working memory at session start, a long-term memory recalled on demand, and an archive.
100
+ - **[Pluggable ontology](docs/capabilities.html#ontology)** — ship your own schema bundle; the default (ArchiMate 3.2 + ARGO extensions) is data, not code.
101
+ - **[Semantic + structural retrieval](docs/capabilities.html#retrieval)** — Graph RAG recall plus read-only Cypher for exact structure.
102
+ - **[Deduplicated writes](docs/capabilities.html#quality)** — reuse an existing element, relationship, or view instead of copying it; near-duplicates are blocked as candidates.
103
+ - **[Acceptance-test-first + traceability](docs/capabilities.html#quality)** — every change is testable, and the commit id is registered back onto the element.
104
+ - **[Enterprise Architect interop](docs/capabilities.html#interop)** — the graph projects to `.qea`; human EA edits return as a semantic diff.
105
+ - **[Federated graph sharing](docs/capabilities.html#federation)** — sovereign graphs joined by a registry–broker; reads authorized and returned by reference.
106
+ - **[One MCP interface, six hosts](docs/capabilities.html#harness)** — install once, run in Copilot, Cursor, OpenCode, DeepSeek Harness, OpenClaw, and Codex.
107
+
108
+ ## How to use
109
+
110
+ **Initialize once** (`argo init`), then open your project and let your coding agent work. It will:
78
111
 
79
112
  1. locate the architecture element behind the task before changing anything,
80
113
  2. arm itself with that element's Skills and Rules,
81
- 3. work test-first (GIVEN-WHEN-THEN), and trace every commit back to the graph,
82
- 4. reuse an existing element, relationship, or view instead of creating a duplicate — the write path
83
- deduplicates by identity and flags a semantically near element of the same type.
114
+ 3. work test-first (GIVEN-WHEN-THEN) and trace every commit back to the graph,
115
+ 4. reuse an existing element by default — a near-duplicate needs an explicit override.
116
+
117
+ The intent architecture graph is the single source of truth.
118
+
119
+ ## Supported Harnesses
84
120
 
85
- The intent architecture graph — modelled in **ArchiMate 3.2** — is the single source of truth.
121
+ | Harness | MCP | Skills | Rules | Agents |
122
+ |---------|:---:|:------:|:-----:|:------:|
123
+ | GitHub Copilot | ✓ | ✓ | ✓ | ✓ |
124
+ | Cursor | ✓ | ✓ | ✓ | ✓ |
125
+ | OpenCode | ✓ | ✓ | ✓ | ✓ |
126
+ | DeepSeek Harness | ✓ | ✓ | ✓ | ✓ |
127
+ | OpenClaw | ✓ | ✓ | ✓ | — |
128
+ | Codex | ✓ | ✓ | ✓ | — |
129
+
130
+ A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness automatically.
131
+
132
+ ## Cross-project read/write
133
+
134
+ Cross-project access runs over **two separate channels** — they must not be conflated:
135
+
136
+ 1. **Local path** — a per-call `workspaceRoot` reads a peer project's graph on the same machine. Writes are **read-only by design**: a foreign write is refused with `WORKSPACE_WRITE_DENIED`.
137
+ 2. **Federated** — a per-call `projectId` is routed through the **federation center**, authorized there (denied by default), and returned by reference.
138
+
139
+ Whether the local channel works depends on the harness, because a harness may bridge the MCP server and pin the workspace per call:
140
+
141
+ | Harness | Local read (`workspaceRoot`) | Local write | Federated read (`projectId`) |
142
+ |---------|:----------------------------:|:-----------:|:----------------------------:|
143
+ | OpenCode | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
144
+ | Codex | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
145
+ | DeepSeek Harness | ✗ | ✗ | ✓ |
146
+ | GitHub Copilot | ✓ | blocked (`WORKSPACE_WRITE_DENIED`) | ✓ |
147
+ | Cursor | 待测 | 待测 | ✓ |
148
+ | OpenClaw | 不涉及 | 不涉及 | ✓ |
149
+
150
+ DeepSeek Harness **cannot** do local cross-project access: its bridge pins the session workspace, so the request never reaches the server as written and only the federated channel works.
86
151
 
87
152
  ## Community
88
153
 
89
- ArchGraph runs on open co-building. Join the community hub to share, browse and reuse **architecture
90
- subgraphs** across projects, and follow the governance & contribution guides:
154
+ ArchGraph runs on open co-building: share and reuse **architecture subgraphs** across projects. Sharing is **federated** — each project keeps its graph sovereign, and members register, discover, authorize, and read opened content **by reference** (denied by default; nothing copied or merged). The center is a **registry–broker** that holds federation metadata, never content.
155
+
156
+ - **Community site** — https://argo.derekworkspacev5.com/archgraph/
157
+ - **graph-wiki** (graph-asset home) — https://github.com/derekhu0002/graph-wiki
158
+ - **GitHub** — https://github.com/derekhu0002/archgraph
159
+
160
+ ## Docs
91
161
 
92
- - **Community site** — https://argo.derekworkspacev5.com/archgraph/ (subgraph library, docs, blog)
93
- - **graph-wiki repository** — https://github.com/derekhu0002/graph-wiki (graph-asset home: contribute
94
- a subgraph from your project, or pull one back to reuse)
162
+ - [Getting started](docs/getting-started.html) · [Capabilities](docs/capabilities.html) · [Worked case: Team Graph](docs/case-team-graph.html)
163
+ - [Schema bundles / ontology decoupling](docs/schema-bundle-decoupling.md) · [Self-hosted embeddings](docs/self-hosted-embedding-deployment.md) · [MCP acceptance](docs/mcp-acceptance.md)
164
+ - [Insights](docs/insights.html) — GraphRAG, agent memory, and portable skills.
95
165
 
96
166
  ## License
97
167
 
package/argo/.env.example CHANGED
@@ -1,163 +1,181 @@
1
- # =============================================================================
2
- # ArchGraph (archgraph-argo) environment configuration — EXAMPLE.
3
- #
4
- # Copy this file to the live env file and fill in real values:
5
- # Windows %USERPROFILE%\.argo\.env
6
- # Linux/macOS ~/.argo/.env
7
- # The live file is git-ignored and MUST stay untracked with a restricted ACL;
8
- # this example is committed and contains no secrets.
9
- #
10
- # PART 1 keys are the ONLY keys accepted inside the .env file (any unknown key
11
- # makes the secret-file preflight reject the whole file). PART 2 keys are
12
- # host/process-level only — set them in the host/MCP launch config or shell, NOT
13
- # here. Empty values below are placeholders.
14
- # =============================================================================
15
-
16
-
17
- # -----------------------------------------------------------------------------
18
- # PART 1 — .env file keys
19
- # -----------------------------------------------------------------------------
20
-
21
- # --- Embedding provider (required) — powers vector semantic retrieval -------
22
- # Provider profile: "approved" (default) = the human-approved cloud profile
23
- # below; "openai-compatible" = a self-hosted OpenAI-compatible endpoint
24
- # (intranet/offline) whose URL/model/label/dimension are read verbatim.
25
- ARGO_EMBEDDING_PROFILE=
26
- # OpenAI-compatible embedding endpoint base URL (no trailing slash).
27
- ARGO_EMBEDDING_BASE_URL=
28
- # Embedding model id (e.g. qwen3.7-text-embedding).
29
- ARGO_EMBEDDING_MODEL=
30
- # Provider label recorded in evidence; also the rerank fallback provider.
31
- ARGO_EMBEDDING_PROVIDER=
32
- # Model version / qualification label (recorded evidence only).
33
- ARGO_EMBEDDING_MODEL_VERSION=
34
- # Embedding vector dimension; must match the model and the vector index
35
- # (current profiles: 1536).
36
- ARGO_EMBEDDING_DIMENSIONS=
37
- # Query-side instruction prefix for instruction-tuned embedding models (e.g.
38
- # gte-Qwen2: "Instruct: <task>\nQuery: "). Empty = no prefix. Documents are
39
- # never prefixed; only the query side is.
40
- ARGO_EMBEDDING_QUERY_INSTRUCTION=
41
- # Optional embedding API key. SECRET: overrides QWEN_KEY as the Bearer token for
42
- # the embeddings call when set (useful for a self-hosted endpoint). Leave empty
43
- # to use QWEN_KEY.
44
- ARGO_EMBEDDING_API_KEY=
45
-
46
- # --- Neo4j (required) — structural projection + vector/full-text store ------
47
- # Neo4j connection URI (e.g. neo4j://127.0.0.1:7687).
48
- ARGO_NEO4J_DATABASE_URL=
49
- # Neo4j username.
50
- ARGO_NEO4J_DATABASE_USERNAME=
51
- # Neo4j password. SECRET: value must come from the untracked, ACL-restricted
52
- # .env (or direct process injection) only — never commit it.
53
- ARGO_NEO4J_DATABASE_PASSWORD=
54
- # Optional: override the Neo4j database name. Default = sanitized repository
55
- # folder name (e.g. repo "archgraph" -> database "archgraph").
56
- ARGO_NEO4J_DATABASE=
57
-
58
- # --- Secrets (required) ------------------------------------------------------
59
- # API key for the embedding endpoint above. SECRET; also the fallback key for
60
- # the reranker when ARGO_RERANK_API_KEY is not set. Never commit it.
61
- QWEN_KEY=
62
-
63
- # --- Semantic retrieval tuning (optional; safe defaults shown) --------------
64
- # Similarity threshold, memory purposes (recall-oriented). Default 0.55.
65
- ARGO_SEMANTIC_MEMORY_THRESHOLD=
66
- # Memory threshold override for the Element channel. Default 0.55.
67
- ARGO_SEMANTIC_MEMORY_THRESHOLD_ELEMENT=
68
- # Memory threshold override for the ArchitectureRelationship channel. Default 0.55.
69
- ARGO_SEMANTIC_MEMORY_THRESHOLD_RELATIONSHIP=
70
- # Memory threshold override for the View channel. Default 0.55.
71
- ARGO_SEMANTIC_MEMORY_THRESHOLD_VIEW=
72
- # Similarity threshold, audit purpose (precision-oriented). Default 0.8.
73
- ARGO_SEMANTIC_AUDIT_THRESHOLD=
74
- # Audit threshold override for the Element channel. Default 0.8.
75
- ARGO_SEMANTIC_AUDIT_THRESHOLD_ELEMENT=
76
- # Audit threshold override for the ArchitectureRelationship channel. Default 0.8.
77
- ARGO_SEMANTIC_AUDIT_THRESHOLD_RELATIONSHIP=
78
- # Audit threshold override for the View channel. Default 0.8.
79
- ARGO_SEMANTIC_AUDIT_THRESHOLD_VIEW=
80
- # Bound on returned candidates per retrieval. Default 8.
81
- ARGO_SEMANTIC_TOP_K=
82
-
83
- # --- Hybrid retrieval (vector + lexical BM25 via RRF; optional) -------------
84
- # Master switch. "1" enables hybrid fusion; unset/"0" = vector-only (default off).
85
- ARGO_SEMANTIC_HYBRID=
86
- # Weight of the vector channel in the RRF fusion. Default 3.
87
- ARGO_SEMANTIC_HYBRID_VECTOR_WEIGHT=
88
- # Weight of the lexical (full-text) channel in the RRF fusion. Default 1.
89
- ARGO_SEMANTIC_HYBRID_LEXICAL_WEIGHT=
90
- # RRF smoothing constant k. Default 60.
91
- ARGO_SEMANTIC_HYBRID_RRF_K=
92
- # Candidate pool size pulled per channel before fusion. Default 16.
93
- ARGO_SEMANTIC_HYBRID_TOP_K=
94
-
95
- # --- LLM rerank (second-stage reordering; optional) -------------------------
96
- # Master switch. "1" enables rerank; unset/"0" = off (default off). Fail-open:
97
- # any error/timeout keeps the original order.
98
- ARGO_SEMANTIC_RERANK=
99
- # Rerank model when using the embedding provider fallback. Default qwen-turbo.
100
- ARGO_SEMANTIC_RERANK_MODEL=
101
- # Candidate pool size offered to the reranker. Default 20.
102
- ARGO_SEMANTIC_RERANK_POOL=
103
- # Max ids the reranker may return. Default 8.
104
- ARGO_SEMANTIC_RERANK_RETURN=
105
- # Per-request rerank timeout in ms (AbortController). Default 3500.
106
- ARGO_SEMANTIC_RERANK_TIMEOUT_MS=
107
- # Dedicated rerank provider (optional). When unset, rerank falls back to the
108
- # embedding provider above. Use these to point rerank at another provider/model
109
- # (e.g. DeepSeek: base https://api.deepseek.com, model deepseek-flash).
110
- ARGO_RERANK_BASE_URL=
111
- # Dedicated rerank API key. SECRET. Falls back to QWEN_KEY when unset.
112
- ARGO_RERANK_API_KEY=
113
- # Dedicated rerank provider label (informational; defaults to the embedding provider label).
114
- ARGO_RERANK_PROVIDER=
115
- # Dedicated rerank model id (overrides ARGO_SEMANTIC_RERANK_MODEL).
116
- ARGO_RERANK_MODEL=
117
- # Disable the rerank model's hidden "thinking"/reasoning (reasoning models spend
118
- # 6-12s per call for a listwise ranking with no accuracy gain). Default 1 =
119
- # disabled; set 0 to send nothing. Applies to every provider so a model swap
120
- # keeps the fast path. If a provider rejects the fragment it is retried without.
121
- ARGO_RERANK_DISABLE_THINKING=
122
- # Exact JSON body fragment merged into the rerank request to disable thinking
123
- # (default {"thinking":{"type":"disabled"}}). Override for another model/provider
124
- # that uses a different field, e.g. {"reasoning_effort":"none"} or
125
- # {"enable_thinking":false}.
126
- ARGO_RERANK_THINKING_PARAM=
127
-
128
- # --- Live end-to-end opt-ins (optional; normally unset) ---------------------
129
- # "1" allows the live embedding-provider E2E to hit the real network.
130
- ARGO_LIVE_PROVIDER_E2E=
131
- # "1" allows the live W3.1 mutation-vector E2E to hit the real network.
132
- ARGO_W31_LIVE_MUTATION_VECTOR_E2E=
133
-
134
-
135
- # -----------------------------------------------------------------------------
136
- # PART 2 — host / process-level only (do NOT put these in .env)
137
- # Set in the host or MCP launch configuration (mcp.json / opencode.json env,
138
- # dsh plugin, or the shell), never in the .env file.
139
- # -----------------------------------------------------------------------------
140
- # Point at a non-default env file path.
141
- # ARGO_ENV_FILE=
142
- # Pin the workspace/repository root the MCP server serves.
143
- # ARGO_REPO_ROOT=
144
- # Path to the Enterprise Architect model file (.qea) to project to/from.
145
- # ARGO_EA_QEA=
146
- # Semicolon-separated roots for multi-workspace hosts (DSH plugin).
147
- # ARGO_WORKSPACE_ROOTS=
148
- # Explicit path to the argo MCP server entry script (DSH plugin).
149
- # ARGO_SERVER_PATH=
150
- # URL of the graph-mcp HTTP bridge.
151
- # GRAPH_MCP_URL=
152
- # "1" enables verbose EA <-> .qea sync debug logging.
153
- # EA_QEA_DEBUG=
154
- # Architecture test runner timeout in ms.
155
- # ARGO_TEST_TIMEOUT_MS=
156
- # "1" prints the full mutation response for debugging.
157
- # ARGO_MCP_MUTATION_RESPONSE_DEBUG=
158
- # "0" disables the pre-write semantic dedup advisory (default: enabled).
159
- # ARGO_MCP_SEMANTIC_DEDUP=
160
- # Similarity threshold for the semantic dedup advisory. Default 0.85.
161
- # ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD=
162
- # Alias of ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD (takes precedence when set).
163
- # ARGO_SEMANTIC_DEDUP_THRESHOLD=
1
+ # =============================================================================
2
+ # ArchGraph (archgraph-argo) environment configuration — EXAMPLE.
3
+ #
4
+ # Copy this file to the live env file and fill in real values:
5
+ # Windows %USERPROFILE%\.argo\.env
6
+ # Linux/macOS ~/.argo/.env
7
+ # The live file is git-ignored and MUST stay untracked (never commit it);
8
+ # this example is committed and contains no secrets.
9
+ #
10
+ # PART 1 keys are the ONLY keys accepted inside the .env file (any unknown key
11
+ # makes the secret-file preflight reject the whole file). PART 2 keys are
12
+ # host/process-level only — set them in the host/MCP launch config or shell, NOT
13
+ # here. Empty values below are placeholders.
14
+ # =============================================================================
15
+
16
+
17
+ # -----------------------------------------------------------------------------
18
+ # PART 1 — .env file keys
19
+ # -----------------------------------------------------------------------------
20
+
21
+ # --- Embedding provider (required) — powers vector semantic retrieval -------
22
+ # Provider profile: "approved" (default) = the human-approved cloud profile
23
+ # below; "openai-compatible" = a self-hosted OpenAI-compatible endpoint
24
+ # (intranet/offline) whose URL/model/label/dimension are read verbatim.
25
+ ARGO_EMBEDDING_PROFILE=
26
+ # OpenAI-compatible embedding endpoint base URL (no trailing slash).
27
+ ARGO_EMBEDDING_BASE_URL=
28
+ # Embedding model id (e.g. qwen3.7-text-embedding).
29
+ ARGO_EMBEDDING_MODEL=
30
+ # Provider label recorded in evidence; also the rerank fallback provider.
31
+ ARGO_EMBEDDING_PROVIDER=
32
+ # Model version / qualification label (recorded evidence only).
33
+ ARGO_EMBEDDING_MODEL_VERSION=
34
+ # Embedding vector dimension; must match the model and the vector index
35
+ # (current profiles: 1536).
36
+ ARGO_EMBEDDING_DIMENSIONS=
37
+ # Query-side instruction prefix for instruction-tuned embedding models (e.g.
38
+ # gte-Qwen2: "Instruct: <task>\nQuery: "). Empty = no prefix. Documents are
39
+ # never prefixed; only the query side is.
40
+ ARGO_EMBEDDING_QUERY_INSTRUCTION=
41
+ # Optional embedding API key. SECRET: overrides QWEN_KEY as the Bearer token for
42
+ # the embeddings call when set (useful for a self-hosted endpoint). Leave empty
43
+ # to use QWEN_KEY.
44
+ ARGO_EMBEDDING_API_KEY=
45
+
46
+ # --- Neo4j (required) — structural projection + vector/full-text store ------
47
+ # Neo4j connection URI (e.g. neo4j://127.0.0.1:7687).
48
+ ARGO_NEO4J_DATABASE_URL=
49
+ # Neo4j username.
50
+ ARGO_NEO4J_DATABASE_USERNAME=
51
+ # Neo4j password. SECRET: value must come from the untracked
52
+ # .env (or direct process injection) only — never commit it.
53
+ ARGO_NEO4J_DATABASE_PASSWORD=
54
+ # Optional: override the Neo4j database name. Default = sanitized repository
55
+ # folder name (e.g. repo "archgraph" -> database "archgraph").
56
+ ARGO_NEO4J_DATABASE=
57
+
58
+ # --- Secrets (required) ------------------------------------------------------
59
+ # API key for the embedding endpoint above. SECRET; also the fallback key for
60
+ # the reranker when ARGO_RERANK_API_KEY is not set. Never commit it.
61
+ QWEN_KEY=
62
+
63
+ # --- Semantic retrieval tuning (optional; safe defaults shown) --------------
64
+ # Similarity threshold, memory purposes (recall-oriented). Default 0.55.
65
+ ARGO_SEMANTIC_MEMORY_THRESHOLD=
66
+ # Memory threshold override for the Element channel. Default 0.55.
67
+ ARGO_SEMANTIC_MEMORY_THRESHOLD_ELEMENT=
68
+ # Memory threshold override for the ArchitectureRelationship channel. Default 0.55.
69
+ ARGO_SEMANTIC_MEMORY_THRESHOLD_RELATIONSHIP=
70
+ # Memory threshold override for the View channel. Default 0.55.
71
+ ARGO_SEMANTIC_MEMORY_THRESHOLD_VIEW=
72
+ # Similarity threshold, audit purpose (precision-oriented). Default 0.8.
73
+ ARGO_SEMANTIC_AUDIT_THRESHOLD=
74
+ # Audit threshold override for the Element channel. Default 0.8.
75
+ ARGO_SEMANTIC_AUDIT_THRESHOLD_ELEMENT=
76
+ # Audit threshold override for the ArchitectureRelationship channel. Default 0.8.
77
+ ARGO_SEMANTIC_AUDIT_THRESHOLD_RELATIONSHIP=
78
+ # Audit threshold override for the View channel. Default 0.8.
79
+ ARGO_SEMANTIC_AUDIT_THRESHOLD_VIEW=
80
+ # Bound on returned candidates per retrieval. Default 8.
81
+ ARGO_SEMANTIC_TOP_K=
82
+
83
+ # --- Hybrid retrieval (vector + lexical BM25 via RRF; optional) -------------
84
+ # Master switch. "1" enables hybrid fusion; unset/"0" = vector-only (default off).
85
+ ARGO_SEMANTIC_HYBRID=
86
+ # Weight of the vector channel in the RRF fusion. Default 3.
87
+ ARGO_SEMANTIC_HYBRID_VECTOR_WEIGHT=
88
+ # Weight of the lexical (full-text) channel in the RRF fusion. Default 1.
89
+ ARGO_SEMANTIC_HYBRID_LEXICAL_WEIGHT=
90
+ # RRF smoothing constant k. Default 60.
91
+ ARGO_SEMANTIC_HYBRID_RRF_K=
92
+ # Candidate pool size pulled per channel before fusion. Default 16.
93
+ ARGO_SEMANTIC_HYBRID_TOP_K=
94
+
95
+ # --- LLM rerank (second-stage reordering; optional) -------------------------
96
+ # Master switch. "1" enables rerank; unset/"0" = off (default off). Fail-open:
97
+ # any error/timeout keeps the original order.
98
+ ARGO_SEMANTIC_RERANK=
99
+ # Rerank model when using the embedding provider fallback. Default qwen-turbo.
100
+ ARGO_SEMANTIC_RERANK_MODEL=
101
+ # Candidate pool size offered to the reranker. Default 20.
102
+ ARGO_SEMANTIC_RERANK_POOL=
103
+ # Max ids the reranker may return. Default 8.
104
+ ARGO_SEMANTIC_RERANK_RETURN=
105
+ # Per-request rerank timeout in ms (AbortController). Default 3500.
106
+ ARGO_SEMANTIC_RERANK_TIMEOUT_MS=
107
+ # Dedicated rerank provider (optional). When unset, rerank falls back to the
108
+ # embedding provider above. Use these to point rerank at another provider/model
109
+ # (e.g. DeepSeek: base https://api.deepseek.com, model deepseek-flash).
110
+ ARGO_RERANK_BASE_URL=
111
+ # Dedicated rerank API key. SECRET. Falls back to QWEN_KEY when unset.
112
+ ARGO_RERANK_API_KEY=
113
+ # Dedicated rerank provider label (informational; defaults to the embedding provider label).
114
+ ARGO_RERANK_PROVIDER=
115
+ # Dedicated rerank model id (overrides ARGO_SEMANTIC_RERANK_MODEL).
116
+ ARGO_RERANK_MODEL=
117
+ # Disable the rerank model's hidden "thinking"/reasoning (reasoning models spend
118
+ # 6-12s per call for a listwise ranking with no accuracy gain). Default 1 =
119
+ # disabled; set 0 to send nothing. Applies to every provider so a model swap
120
+ # keeps the fast path. If a provider rejects the fragment it is retried without.
121
+ ARGO_RERANK_DISABLE_THINKING=
122
+ # Exact JSON body fragment merged into the rerank request to disable thinking
123
+ # (default {"thinking":{"type":"disabled"}}). Override for another model/provider
124
+ # that uses a different field, e.g. {"reasoning_effort":"none"} or
125
+ # {"enable_thinking":false}.
126
+ ARGO_RERANK_THINKING_PARAM=
127
+
128
+ # --- Live end-to-end opt-ins (optional; normally unset) ---------------------
129
+ # "1" allows the live embedding-provider E2E to hit the real network.
130
+ ARGO_LIVE_PROVIDER_E2E=
131
+ # "1" allows the live W3.1 mutation-vector E2E to hit the real network.
132
+ ARGO_W31_LIVE_MUTATION_VECTOR_E2E=
133
+
134
+
135
+ # -----------------------------------------------------------------------------
136
+ # PART 2 — host / process-level only (do NOT put these in .env)
137
+ # Set in the host or MCP launch configuration (mcp.json / opencode.json env,
138
+ # dsh plugin, or the shell), never in the .env file.
139
+ # -----------------------------------------------------------------------------
140
+ # Point at a non-default env file path.
141
+ # ARGO_ENV_FILE=
142
+ # Pin the workspace/repository root the MCP server serves.
143
+ # ARGO_REPO_ROOT=
144
+ # Explicit schema-bundle directory (highest precedence): overrides both the
145
+ # repository's own <workspace>/.argo/schema bundle and the default ArchiMate 3.2
146
+ # bundle. Must contain SystemArchitecture.schema.json.
147
+ # ARGO_SCHEMA_DIR=
148
+ # Actor element type the wakeup gate looks up when a workspace schema renames
149
+ # it. Default: Business Actor.
150
+ # ARGO_ACTOR_ELEMENT_TYPE=
151
+ # Path to the Enterprise Architect model file (.qea) to project to/from.
152
+ # ARGO_EA_QEA=
153
+ # Semicolon-separated roots for multi-workspace hosts (DSH plugin).
154
+ # ARGO_WORKSPACE_ROOTS=
155
+ # Explicit path to the argo MCP server entry script (DSH plugin).
156
+ # ARGO_SERVER_PATH=
157
+ # URL of the graph-mcp HTTP bridge.
158
+ # GRAPH_MCP_URL=
159
+ # "1" enables verbose EA <-> .qea sync debug logging.
160
+ # EA_QEA_DEBUG=
161
+ # Architecture test runner timeout in ms.
162
+ # ARGO_TEST_TIMEOUT_MS=
163
+ # "1" prints the full mutation response for debugging.
164
+ # ARGO_MCP_MUTATION_RESPONSE_DEBUG=
165
+ # "0" disables the pre-write semantic dedup advisory (default: enabled).
166
+ # ARGO_MCP_SEMANTIC_DEDUP=
167
+ # Similarity threshold for the semantic dedup advisory. Default 0.85.
168
+ # ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD=
169
+ # Alias of ARGO_MCP_SEMANTIC_DEDUP_THRESHOLD (takes precedence when set).
170
+ # ARGO_SEMANTIC_DEDUP_THRESHOLD=
171
+ # Cross-project WRITE guard. Default ON: a write tool may only target the
172
+ # server's own (home) workspace, so a foreign per-call workspaceRoot is
173
+ # rejected fail-closed while cross-project READS stay open. "0" disables it
174
+ # (all-or-nothing) for a trusted multi-workspace host that legitimately writes
175
+ # several workspaces through one server.
176
+ # ARGO_WORKSPACE_WRITE_GUARD=
177
+ # Set to "1" by a trusted host broker (e.g. the DSH workspace bridge) to assert
178
+ # it controls the per-call `sessionWorkspaceRoot` field; the argo server then
179
+ # allows WRITES to that host-designated session workspace as well as its home
180
+ # workspace. A model cannot set a process env var, so the trust is unforgeable.
181
+ # ARGO_WORKSPACE_ROOT_TRUSTED=