Skip to main content

Governed authoring layer above DKG v10: commit-gated Agience artifacts, policy-controlled projection, FLARE confidentiality, typed agience: RDF Knowledge Assets.

Project description

agience-flare-dkg-integration

The governance layer above dkg mcp setup. OriginTrail's official dkg mcp setup (shipped 7 May 2026) makes MCP-to-DKG a two-command commodity. This package is what sits upstream — committed Agience Core artifacts, optional FLARE confidentiality, and typed agience: RDF Knowledge Assets — so what reaches Working Memory is governed, attributable, and SPARQL-queryable, not raw LLM output.

See the head-to-head comparison and design brief.

Features

  • MCP stdio server (agience-dkg-mcp) — exposes agience_wm_write, agience_promote, agience_search tools for Claude Desktop, Cursor, Claude Code, and any MCP host
  • Writes committed Agience artifacts to DKG v10 Working Memory as typed JSON-LD Knowledge Assets with the agience: RDF vocabulary — SPARQL-queryable by type, author, collection, and memory layer
  • Promotes eligible assets to Shared Memory (SHARE) via the daemon's POST /api/knowledge-assets/{name}/swm/share (or dkg-create with privacy=public on MCP transport)
  • Searches across memory layers via the daemon's POST /api/query (or dkg-sparql-query on MCP transport)
  • Default transport: direct HTTP to the local DKG v10 daemon at http://127.0.0.1:9201; bearer token auto-read from ~/.dkg/auth.token. Alternative transport: MCP Streamable HTTP at POST /mcp with SSE stream handling
  • Distinguishes transport success from blockchain anchoring state (status: anchored vs status: pending)
  • FLARE optional path: when policy_class = "internal-confidential", only derived projections reach DKG; raw content stays encrypted

Install

pip install agience-flare-dkg-integration

MCP Server (Claude Desktop, Cursor, etc.)

Default config uses the local DKG v10 daemon — no token is needed because the daemon transport auto-reads ~/.dkg/auth.token:

{
  "mcpServers": {
    "agience-dkg": {
      "command": "agience-dkg-mcp",
      "env": {
        "DKG_BASE_URL": "http://127.0.0.1:9201"
      }
    }
  }
}

Tools: agience_wm_write, agience_promote, agience_search.

To target an MCP-fronted DKG node instead, add "DKG_TRANSPORT": "mcp", set "DKG_BASE_URL": "http://localhost:8083", and add "DKG_TOKEN": "<mcp-bearer>".

CLI

# Default: local DKG v10 daemon. Bearer token auto-read from ~/.dkg/auth.token.
# DKG_BASE_URL defaults to http://127.0.0.1:9201 if unset.

# Write to Working Memory
agience-dkg wm-write \
  --title "Architecture Decision: use DKG v10" \
  --artifact-type decision \
  --artifact-id art-001 \
  --content "We will use DKG v10 Working Memory as the shared knowledge substrate." \
  --context-graph-id agience-demo \
  --collection-id my-project

# Promote to Shared Memory (SHARE)
# Pass the Knowledge Asset NAME from the wm-write output (e.g. "art-001-Architecture-Decision-..."),
# NOT the rc.17 turnUri (its trailing revision index does not contain the KA name).
agience-dkg promote <ka-name> --context-graph-id agience-demo

# Search
agience-dkg search "architecture decisions" --context-graph-id agience-demo

Resolved invocation block. Every wm-write call prints a # agience-dkg wm-write — resolved invocation (copy to replay): block to stdout before the HTTP call fires, showing all fully-resolved flags with tokens truncated to 8 chars. Useful for testers and reviewers to copy and replay the exact command.

For MCP-fronted DKG nodes, add --transport mcp --base-url http://localhost:8083 --token <mcp-bearer>.

Python API

from agience_dkg_integration import DkgDaemonClient, MemoryTurnRequest
from agience_dkg_integration.formatter import artifact_to_markdown, session_uri_for_collection

# Default: local DKG v10 daemon. Bearer token auto-resolves from ~/.dkg/auth.token.
client = DkgDaemonClient(base_url="http://127.0.0.1:9201")

# Alternative: MCP-fronted DKG node
# from agience_dkg_integration import DkgHttpClient
# client = DkgHttpClient(base_url="http://localhost:8083", bearer_token="<mcp-bearer>")

result = client.memory_turn(MemoryTurnRequest(
    contextGraphId="agience-demo",
    markdown=artifact_to_markdown(title="My Note", content="...", artifact_type="research-note", artifact_id="art-001"),
    layer="wm",
    sessionUri=session_uri_for_collection("my-project"),
))
print(result.turn_uri)

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agience_flare_dkg_integration-0.4.3.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agience_flare_dkg_integration-0.4.3-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file agience_flare_dkg_integration-0.4.3.tar.gz.

File metadata

File hashes

Hashes for agience_flare_dkg_integration-0.4.3.tar.gz
Algorithm Hash digest
SHA256 a8020d0f2cc528d5a2e2bee50628569133fe152918e4e91ae5436ab699798496
MD5 3650cd89a0d805c667b9b13716d10b14
BLAKE2b-256 067c0f9f8f2bb9d2223b1719cfa3c6a9aea0a1fb99de08b667017ac127e44ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for agience_flare_dkg_integration-0.4.3.tar.gz:

Publisher: publish.yml on Muffinman75/agience-flare-dkg-integration

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agience_flare_dkg_integration-0.4.3-py3-none-any.whl.

File metadata

File hashes

Hashes for agience_flare_dkg_integration-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cfccc07116ac929c88a15a7a98db308119649dcbce70440923105157e56fe191
MD5 91133cfde61bab5c4693cbb93e5f15fd
BLAKE2b-256 fe78d89254639e6baad4bf939c5c7c6c09f01623c118e293e6105b263b5b4901

See more details on using hashes here.

Provenance

The following attestation bundles were made for agience_flare_dkg_integration-0.4.3-py3-none-any.whl:

Publisher: publish.yml on Muffinman75/agience-flare-dkg-integration

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page