Skip to main content

Collective Intelligence Overlay

Evidence is shared; admission is local.

A Python overlay for teams that want agents to exchange reusable tools and procedures without treating every generated result as verified. Each participant keeps its own keys, database, acceptance policy and budget. A receiver can inspect a candidate, request more checking, reject it, or reuse it under a specific contract.

The package connects Microsoft Agent Framework (MAF), A2A and MCP. It is not an agent runtime or a central manager. Existing SDKs run tools and compose workflows; the overlay records evidence, qualifies reuse and stops known-invalid dependencies.

日本語 · Tutorial · Architecture

Version 0.2.1 returns execution allowance after a refusal or cancellation only when the database proves no dispatch and fences further dispatch. Inspection costs remain recorded; uncertain effects and old reservations stay held. See upgrade/recovery and release state.

The 0.3.0 development candidate adds bounded owner goals, signed opportunities, peer proposals and local work selection. The host registers the intended use, installed builders and an independently qualified checker; observations then guide finite formation, connection or verification work through the existing Executor. Insufficient evidence, unavailable checkers, allowance shortage and uncertain execution remain explicit stopping conditions. These additions are in the source checkout and are not part of the published 0.2.1 wheel. See the API, external registration example and development gates.

What works

  • Signed, versioned capability and evidence records, including PASS / FAIL / UNKNOWN.
  • Receiver-specific OPA decisions: ACCEPT / REQUALIFY / REJECT / UNKNOWN.
  • PostgreSQL persistence, duplicate/conflict detection, budgets and fenced result commits.
  • Real A2A HTTP exchange, MAF function middleware/workflow composition and MCP HTTP calls.
  • A three-process demo: register CSV tools, independently check their outputs and imported A2A bindings, reuse an HTML report workflow, then revoke its dependency.
  • Typed costs and an explicitly limited deterministic comparison.

Version 0.2.0 adds typed local/MCP/A2A bindings, durable invocations, paged synchronization/history and observed formation receipts. An external document application demonstrates three peers building and checking C3, using it to construct C4, restarting and stopping both descendants after withdrawal. See the tutorial and current validation scope.

A signature establishes origin, not truth. Sample checks do not prove correctness on all future data. Distinct local identities are not independent organizations or statistically independent evidence. This software does not prove intelligence growth.

Run from source

Python 3.12, uv, PostgreSQL 16 and the OPA binary are required for the reference path. No model API key is needed. There is no broker, vector database, mandatory cloud service or always-running OPA server.

git clone https://github.com/kadubon/collective-intelligence-overlay.git
cd collective-intelligence-overlay
uv sync --all-extras --frozen
uv run python scripts/fetch_opa.py

Start a dedicated development PostgreSQL instance. The setup account must be able to create roles and databases. See the tutorial for Docker, Linux and PowerShell commands. Then:

export CIO_TEST_DATABASE_URL='postgresql+pg8000://postgres:development-only@127.0.0.1:5432/postgres'
export CIO_OPA="$PWD/.local/bin/opa"
uv run collective-intelligence-overlay demo --directory .local/demo

Expected fields: processes: 3, admission: ACCEPT, report total 117.00, changed_environment: REQUALIFY, after_dependency_revocation: REJECT. Timings vary. The command preserves owner-local artifacts and databases and stops its child processes. Use a new output directory for another run.

For the candidate's isolated fixed-versus-adaptive document comparison, use the same service configuration and a fresh directory:

uv run python examples/evaluate_documents.py --directory .local/document-comparison --opa "$CIO_OPA" --seed 0

In PowerShell, pass --opa "$env:CIO_OPA". This runs six separate three-peer arms with no paid model calls. Normal and input-connection conditions passed three held-out business tasks per arm in the recorded pilot; checking-constrained arms stopped before those tasks. Adaptation showed no outcome or allowance advantage and had higher elapsed observations in that single run. Raw results and limits distinguish working integration from demonstrated benefit.

Version 0.2.1 is published on PyPI. To install into an activated Python 3.12 environment:

uv pip install 'collective-intelligence-overlay[agents]==0.2.1'
collective-intelligence-overlay --version

PostgreSQL and OPA are still required for the reference demo. Actual publication status, hashes and clean-install verification are recorded in releasing. For 0.1.0 upgrades, follow migration and recovery.

Add to an existing agent

Importing the core never opens a database or runs a migration. The host supplies an Overlay, explicitly installed Registry bindings and a persistent Executor:

registry.register_local(binding, operation, assess)
invocation = await executor.invoke(
    "caller-stable-operation-id", binding.id, binding.digest, arguments, context
)

Here the host supplies the pinned binding, installed function, input assessment, execution context and executor connected to that registry. Publish the corresponding candidate and obtain independent evidence before ordinary reuse. The executor checks the binding and actual inputs at execution, reserves the owner's budget and retains the result under the caller's stable ID. Completion is not an independent PASS. A previous ACCEPT is not a permanent permission. The lower-level Overlay.execute callback API remains available for compatibility. Integration shows registration, MAF middleware and the real, opt-in model example. See API and CLI for configuration, exceptions, cancellation and the operator/agent boundary.

For example, a verifier's PASS for csv-sum@1 in environment reference=1 does not admit it in reference=2. The receiver requests requalification. A valid in-scope counterexample is retained alongside the PASS and takes precedence in the standard policy.

Trust and operation

Peers authenticate with distinct pinned Ed25519 identities. Local Rego policy, keys and budgets must be protected from the agent process. Evidence sharing is disabled by default; the demonstration enables it for its configured peers. The DB/host operator is trusted. A malicious infrastructure administrator is outside this model. See security and deployment.

uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run pytest
uv build
uv run twine check --strict dist/*
uv run python scripts/check_package.py

Integration/E2E tests require PostgreSQL and OPA; missing services are explicit skips, not production validation. Paid model calls are off by default. Current checks and unverified boundaries are in validation. Windows and Linux are the initial target platforms; the network reference deployment is Linux-oriented.

New code is Apache-2.0. See LICENSE, NOTICE, dependency compatibility/licensing, research mapping, and contributing.

Metadata

Release files for collective-intelligence-overlay 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective-intelligence-overlay 0.3.0
File Size Uploaded
collective_intelligence_overlay-0.3.0.tar.gz 96.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective-intelligence-overlay 0.3.0
File Interpreter ABI Platform
collective_intelligence_overlay-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 224.9 kB

Release files / collective_intelligence_overlay-0.3.0.tar.gz

Download URL collective_intelligence_overlay-0.3.0.tar.gz
Size 96.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9f83afad28d0ab18a82d34469dd7d400c8f0f761f0f265e5d5f40eb7532eea11
BLAKE2b-256 checksum
How to use checksums
342acc1d0d84419ed2a6aa8cc8d15a07d4622b87ddb2858de9bcd966608a110a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / collective_intelligence_overlay-0.3.0-py3-none-any.whl

Download URL collective_intelligence_overlay-0.3.0-py3-none-any.whl
Size 128.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c482e567f44c4336014885b58fc625654345fffd5753225285aca70369934497
BLAKE2b-256 checksum
How to use checksums
d2b806df5028c7422243b0d778d8cdbe69173d00bcdfa7b6490ed689ca7685db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page