Logo Parallel Reconcile Merge

Parallel Reconcile Merge

Cộng đồng
AnthonyAlcaraz
parallel-reconcile-merge

Controlled-parallelism window for a tree pipeline (Ch5 Tree Pipeline + "The architecture of controlled parallelism" + state reducers, Examples 5-7/5-8/5-16). Dispatches independent branches that read different data and write to separate channels, isolates errors per-branch so one branch's failure neither cascades nor corrupts shared state, then reconciles the survivors with a reducer-style deterministic merge and decides completion as all-or-nothing or partial-coverage. Surfaces the union of every branch's red flags — a failed branch never silently drops a flag. Use when a planning node has verified true independence between branches (fraud / provider / pricing verification; parallel hypothesis tests). NOT for branches that share mutable state or make joint decisions (that is uncoordinated parallelism, the failure mode), NOT for strictly sequential dependent steps, NOT as a thread pool (this is the isolation+merge contract; the concurrency mechanism is a production swap).

Tổng quan

Nhà phát hànhAnthonyAlcaraz
Kho mãagentic-graph-rag-skills
Tên kỹ năngparallel-reconcile-merge
Sao
29
Bản fork
9
Tệp đi kèm
2
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được AnthonyAlcaraz công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Parallel Reconcile Merge trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/parallel-reconcile-merge
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/reasoning-planning/parallel-reconcile-merge .claude/skills/parallel-reconcile-merge
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Parallel Reconcile Merge trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Parallel Reconcile Merge ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Parallel Reconcile Merge với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Parallel Reconcile-Merge

Overview

Parallelism itself is not the enemy — uncoordinated parallelism is. The chapter's safe pattern embeds a parallel window inside a sequential control flow: planning verifies the branches are truly independent, the branches run simultaneously reading different data sources and writing to separate channels, and only the merge node combines them.

This skill implements the execution + reconciliation half:

  • Per-branch error isolation (tree-pipeline error aggregation): each branch runs in isolation; an exception is caught and recorded in that branch's own result. "One branch's failure shouldn't cascade to others or corrupt shared state." Branches receive a copy of context and never write shared state — only the merge node combines them.
  • Reducer-style deterministic merge (Example 5-8): merge successful branch values with a reducer (add, extend, union, max, min) so the result is "deterministic merging regardless of execution order."
  • Completion policy: all_or_nothing (every branch must succeed) vs partial_coverage (a quorum suffices — "sometimes three successful branches out of four provide sufficient coverage").
  • Flag union: any red flag from any branch is surfaced; a failed sibling never silently drops another branch's flag.

In the DevOps latency investigation (account 123456789012), the planner spawns parallel hypothesis tests — database connection-pool metrics and payment-service memory profiles — reading different data sources. The pool branch raises a pool_exhausted flag; the memory branch comes back normal. Reconcile surfaces the flag, merges both findings, and (under all-or-nothing for a confirmation phase) reports completion only if both branches succeeded. The analogous claims case runs fraud / provider-credentials / medical-necessity branches the same way: any flag from any branch affects the final decision.

When to Use

  • A planning node has verified branch independence (different data sources, no shared decision, no shared mutable state)
  • Parallel hypothesis tests, multi-aspect verification (fraud / pricing / credentials), parallel research tracks
  • You need deterministic merge + a quorum/all-or-nothing completion policy + flag aggregation

Phrases: "merge parallel branches", "reconcile branch results", "controlled parallelism", "error isolation across branches", "all-or-nothing vs partial coverage", "state reducer merge".

When NOT to Use

  • Branches share mutable state or make a joint decision (uncoordinated parallelism — the documented failure mode; serialize or re-decompose first)
  • Strictly sequential dependent steps (use a sequential pipeline)
  • You actually need concurrency tuning — this is the isolation+merge contract; swap in threads/asyncio/Send API for the dispatch mechanism in production

Process

StepInputActionOutputVerification
1branch_fns (name -> fn), contextlib.execute_branches(...)list of BranchResulta raising branch yields ok=False and does NOT abort siblings
2branch values + reducer namelib.reduce_field(values, REDUCERS[name])merged valuemerge is order-independent for commutative reducers
3results + mode + min_success + reducerlib.reconcile(...)MergeOutcomeall_or_nothing fails if any branch failed; partial_coverage completes at quorum; flags are unioned
4branch_fns + context (+policy)lib.run_parallel_window(...)end-to-end MergeOutcomesucceeded/failed partition matches branch outcomes

Rationalizations

Agent rationalizationDocumented rebuttal
"Just let the branches share state — it's simpler."Shared mutable state across parallel branches is exactly the uncoordinated-parallelism failure Cognition documents. The chapter's branches "read from different knowledge graph regions and write their findings to separate channels that only the orchestrator combines."
"If one branch fails, fail the whole thing."Only under all-or-nothing. The chapter notes "three successful branches out of four provide sufficient coverage" for many tasks — partial-coverage is a first-class mode. Pick the mode per task; do not hard-fail by default.
"A crashed branch — just drop it and its flags."Error isolation records the failure; flag union still surfaces every flag from every branch. A dropped flag (e.g. a fraud signal) is a silent correctness hole. Failure isolation is not the same as discarding signal.
"Combine the branch scores any way — order won't matter."Only commutative reducers are order-safe. The reducer pattern (Example 5-8) exists precisely so merge is "deterministic regardless of execution order"; ad-hoc combination reintroduces race-order dependence.

Red Flags

  • Branches mutate context and expect siblings to see it. They get copies by design; a branch relying on another branch's write is not independent and should not be in this window.
  • all_or_nothing chosen for an exploratory fan-out. One flaky branch fails the whole window when partial coverage would have sufficed — wrong mode for the task.
  • Flags empty but a branch reported a problem in its value. The branch is not surfacing red flags through the flags channel; the merge cannot union what it cannot see.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report:
    • a raising branch is isolated (ok=False) and siblings still run
    • all_or_nothing completes only when every branch succeeds
    • partial_coverage completes at the quorum and fails below it
    • flags are unioned across branches (including from non-failing siblings)
    • reducer merge is order-independent for a commutative reducer
    • succeeded/failed partition matches branch outcomes
  2. Verify CLI help. Exits 0 and prints the SKILL.md description.

Security Posture

  • Prompt injection. Branch results are untrusted - branches typically run LLM reasoning over untrusted sources. The merge treats values and flags as data (reducers, unions), never executing them; one compromised branch can bias the merged value but cannot rewrite siblings' channels, because branches get context copies and only the merge node combines.
  • Data exfiltration. No network calls, no file writes in the window itself. The merge concentrates findings from every branch into one outcome - apply per-branch data-access policy upstream, since the merged report sees everything any branch saw.
  • Privilege escalation. No shell invocation, no eval. The guarded property is signal integrity: flag union guarantees a failed or malicious sibling cannot suppress another branch's fraud/red flag, and completion policy - not any single branch - decides whether the window counts as done.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch5 — Reasoning & Planning: "Tree Pipeline: Parallel Exploration" (Example 5-7), "State management across pipelines" reducer pattern (Example 5-8), and "The Multi-Agent Debate" / "The architecture of controlled parallelism" (Example 5-16) — independence verification, per-branch error isolation, and the ontologically-validated merge.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Parallel Reconcile Merge làm được gì?

Controlled-parallelism window for a tree pipeline (Ch5 Tree Pipeline + "The architecture of controlled parallelism" + state reducers, Examples 5-7/5-8/5-16). Dispatches independent branches that read different data and write to separate channels, isolates errors per-branch so one branch's failure neither cascades nor corrupts shared state, then reconciles the survivors with a reducer-style deterministic merge and decides completion as all-or-nothing or partial-coverage. Surfaces the union of every branch's red flags — a failed branch never silently drops a flag. Use when a planning node has...

Vì sao nên dùng Parallel Reconcile Merge trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Parallel Reconcile Merge là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Parallel Reconcile Merge trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/parallel-reconcile-merge. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Parallel Reconcile Merge?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Parallel Reconcile Merge với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Parallel Reconcile Merge với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Parallel Reconcile Merge có miễn phí không?

Có. Kỹ năng này được AnthonyAlcaraz phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇