Skip to content

Latest commit

Β 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Octo πŸ™

A bioregional knowledge commoning agent for the Salish Sea

Octo is an AI agent built on OpenClaw (our fork of openclaw/openclaw) that serves as an organ of perception for the Salish Sea bioregion. It combines a knowledge graph backend with a formal ontology for bioregional knowledge commoning β€” enabling it to reason about practices, patterns, discourse, and the relationships between them.

Octo is also a KOI-net federation coordinator β€” it aggregates knowledge from leaf-node agents (Greater Victoria, Cowichan Valley, etc.) into a unified Salish Sea knowledge commons using the KOI-net protocol for authenticated, event-driven federation.

What Octo Does

  • Knowledge Commoning: Tracks bioregional practices, identifies trans-bioregional patterns, and documents case studies using a formal ontology grounded in the work of David Bollier & Silke Helfrich
  • Discourse Graph: Manages questions, claims, and evidence with typed relationships (supports, opposes, informs) β€” enabling progressive formalization of bioregional knowledge
  • Entity Resolution: Multi-tier entity resolution (exact β†’ fuzzy β†’ semantic β†’ create) with OpenAI embeddings and pgvector
  • Web Content Curation: Users share URLs via Telegram/Discord, Octo previews (with Playwright for JS-rendered sites), evaluates bioregional relevance, and ingests into the knowledge graph with entity linking
  • Vault Integration: Bidirectional linking between an Obsidian-style vault and a PostgreSQL knowledge graph
  • KOI-net Federation: Authenticated event-driven protocol for cross-bioregional knowledge sharing with ECDSA-signed envelopes, background polling, and cross-reference resolution

Website

The Salish Sea Knowledge Garden is Octo's public-facing knowledge site β€” a browsable, searchable view of the knowledge graph with an interactive D3.js visualization and a chatbot for asking Octo questions directly.

  • Canonical URL: https://45.132.245.30.sslip.io
  • Legacy/raw-IP URL: http://45.132.245.30

Architecture

Holonic Network

[Greater Victoria]   [Cowichan Valley]      ← leaf nodes (bioregional agents)
        β†˜                 ↙
   [Octo / Salish Sea Coordinator]         ← federation coordinator
        ↕                 ↓
   [Front Range]    [Cascadia Coordinator]  ← future meta-coordinator
   port 8355 (local)     ↑ separate bioregional network
                         (peer of Cascadia, not under it)

Each node runs the same KOI API codebase with its own database, vault, and identity. Nodes exchange events via the KOI-net protocol β€” when a practice is registered in Greater Victoria, it appears as a cross-reference in Octo within seconds.

Single Node

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  OpenClaw Runtime                  β”‚
β”‚  (Telegram / Discord / CLI)                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Workspace: IDENTITY.md, SOUL.md, KNOWLEDGE.md   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  bioregional-koi plugin (OpenClaw)                 β”‚
β”‚  β”œβ”€ Entity resolution (resolve, register, search) β”‚
β”‚  β”œβ”€ Web content curation (preview_url, ingest_url)β”‚
β”‚  β”œβ”€ Vault read/write                              β”‚
β”‚  β”œβ”€ Relationship sync                             β”‚
β”‚  └─ 15 tools per koi-tool-contract                β”‚
β”‚  OR: MCP server (personal-koi-mcp) β€” same 15 toolsβ”‚
β”‚       for Claude Code / Cursor / MCP hosts         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  KOI Processor API (uvicorn)                      β”‚
β”‚  β”œβ”€ entity_schema.py  (15 entity types)           β”‚
β”‚  β”œβ”€ vault_parser.py   (27 predicates, aliases)    β”‚
β”‚  β”œβ”€ web_fetcher.py    (URL fetch + Playwright)    β”‚
β”‚  β”œβ”€ personal_ingest_api.py                        β”‚
β”‚  └─ KOI-net protocol (feature flag)               β”‚
β”‚     β”œβ”€ koi_net_router.py   (8 protocol endpoints) β”‚
β”‚     β”œβ”€ koi_envelope.py     (ECDSA P-256 signing)  β”‚
β”‚     β”œβ”€ koi_poller.py       (background poller)     β”‚
β”‚     β”œβ”€ event_queue.py      (DB-backed queue)       β”‚
β”‚     └─ node_identity.py    (keypair + RID)         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  PostgreSQL + pgvector + Apache AGE               β”‚
β”‚  (Docker, localhost:5432)                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Live Agents

Agent Port Node RID Entities KOI-net
Octo (Salish Sea) 8351 orn:koi-net.node:octo-salish-sea+f0655... 70 Enabled (coordinator)
Greater Victoria 37.27.48.12:8351 (remote, poly) orn:koi-net.node:greater-victoria+81ec4... 4 Enabled (leaf node)
Front Range 127.0.0.1:8355 (localhost on Octo) orn:koi-net.node:front-range+b5429... 4 Enabled (peer node)

BKC Ontology

The formal ontology (ontology/bkc-ontology.jsonld) defines 9 entity types and 17 predicates for bioregional knowledge commoning:

Entity Types

Phase Type Description
Knowledge Commoning Practice Bioregional-specific activity or approach
Pattern Trans-bioregional generalization from practices
CaseStudy Documented real-world example
Bioregion Named ecological/cultural region
Discourse Graph Protocol General coordination pattern
Playbook Local implementation of a protocol
Question Inquiry or hypothesis
Claim Assertion or conclusion
Evidence Data, observations, or results

Plus 6 base types inherited from the KOI system: Person, Organization, Project, Location, Concept, Meeting.

Key Predicates

Knowledge Commoning: aggregates_into (Practice β†’ Pattern), suggests (Pattern β†’ Practice), documents (CaseStudy β†’ Practice), practiced_in (Practice β†’ Bioregion)

Discourse Graph: supports, opposes, informs, generates, implemented_by, synthesizes, about

SKOS + Hyphal: broader, narrower, related_to, forked_from, builds_on, inspired_by

See ontology/bkc-ontology.jsonld for the formal OWL/RDFS definitions.

Repository Structure

β”œβ”€β”€ workspace/              # Octo's OpenClaw workspace (agent identity & config)
β”‚   β”œβ”€β”€ IDENTITY.md         # Who Octo is
β”‚   β”œβ”€β”€ SOUL.md             # Philosophy and values
β”‚   β”œβ”€β”€ KNOWLEDGE.md        # BKC domain expertise
β”‚   └── TOOLS.md            # Environment-specific tool config
β”œβ”€β”€ vendor/                 # Vendored KOI runtime code (pinned SHA)
β”‚   β”œβ”€β”€ pin.txt             # Canonical commit SHA to deploy
β”‚   β”œβ”€β”€ sync.sh             # Fetch + vendor at pinned SHA (GitHub fallback)
β”‚   └── koi-processor/      # Vendored code (api/, migrations/, requirements.txt)
β”œβ”€β”€ docker/                 # Docker stack (PostgreSQL + KOI API)
β”‚   β”œβ”€β”€ docker-compose.yml  # Full stack: postgres + koi-api
β”‚   β”œβ”€β”€ Dockerfile.koi-api  # KOI API image (Python 3.12, from vendored code)
β”‚   β”œβ”€β”€ Dockerfile.postgres-age  # PostgreSQL with pgvector + Apache AGE
β”‚   β”œβ”€β”€ init-extensions.sql
β”‚   └── create-additional-dbs.sh
β”œβ”€β”€ scripts/                # Setup + management
β”‚   β”œβ”€β”€ bootstrap.sh        # One-command VPS bootstrap (curl|bash)
β”‚   β”œβ”€β”€ setup-node.sh       # Interactive setup wizard (Docker-based)
β”‚   β”œβ”€β”€ connect-koi-peer.sh # Idempotent peer/coordinator connect helper
β”‚   β”œβ”€β”€ manage-agents.sh    # Start/stop/status for all agents
β”‚   └── test-federation.sh  # End-to-end federation test
β”œβ”€β”€ deploy.sh               # Vendor sync β†’ rsync β†’ migrate β†’ restart β†’ health check
β”œβ”€β”€ gv-agent/               # Greater Victoria leaf node config
β”œβ”€β”€ fr-agent/               # Front Range peer node config
β”œβ”€β”€ plugins/
β”‚   └── bioregional-koi/    # OpenClaw plugin connecting to KOI API
β”œβ”€β”€ ontology/               # Formal BKC ontology (JSON-LD)
β”‚   └── bkc-ontology.jsonld
β”œβ”€β”€ vault-seed/             # Seed entity notes exercising the full predicate chain
└── docs/                   # Guides and strategy
    β”œβ”€β”€ new-bioregion-quickstart.md  # Quick-start guide (~30 min)
    β”œβ”€β”€ join-the-network.md          # Comprehensive reference (all paths)
    └── ...

Getting Started

One-Command Bootstrap (Fresh VPS)

curl -sSL https://raw.githubusercontent.com/BioregionalKnowledgeCommons/Octo/main/scripts/bootstrap.sh | bash

This installs Docker and git, clones the repo, and launches the interactive setup wizard. Everything runs in Docker β€” no Python/pip/venv on the host.

Manual Setup

git clone https://github.com/BioregionalKnowledgeCommons/Octo.git && cd Octo
bash scripts/setup-node.sh

The wizard handles: vendor sync, Docker build, database creation, migrations, keypair generation, workspace files, and federation connection.

See docs/new-bioregion-quickstart.md for the full walkthrough.

Prerequisites

  • Docker (installed automatically by bootstrap.sh if missing)
  • Git
  • An embedding provider (OpenAI API key or local Ollama β€” optional, for semantic entity resolution)

KOI-net Federation

Enable federation by setting KOI_NET_ENABLED=true in the agent's env file. This activates:

  • Protocol endpoints at /koi-net/* (handshake, poll, broadcast, confirm, etc.)
  • ECDSA P-256 signed envelopes for authenticated communication
  • Background poller for event-driven cross-reference creation
  • Time-based exponential retry backoff with automatic recovery when peers come back online (no service restart required)
  • Auto-generated node identity (keypair stored in /root/koi-state/)

Federation readiness checklist (critical):

  • Set KOI_BASE_URL to a peer-reachable URL (not localhost), e.g. http://<public-ip>:8351.
  • Ensure peers can reach /koi-net/* on that URL (direct bind or reverse proxy).
  • Use edge semantics correctly for polling:
    • source_node = node being polled (data provider)
    • target_node = node doing the polling
  • Ensure each peer's public_key is present in koi_net_nodes on the other side.
  • Use POST /koi-net/events/poll (legacy POST /koi-net/poll is not supported).
  • Prefer bash scripts/connect-koi-peer.sh --db <db> --peer-url <url> for idempotent local setup.
  • Keep strict validation disabled during bootstrap:
    • KOI_STRICT_MODE=false
    • KOI_REQUIRE_SIGNED_ENVELOPES=false
    • KOI_REQUIRE_SIGNED_RESPONSES=false
    • KOI_ENFORCE_TARGET_MATCH=false
    • KOI_ENFORCE_SOURCE_KEY_RID_BINDING=false
  • Enable strict mode only after peer coordination confirms signed-envelope compatibility.

KOI endpoint model:

  • Core protocol endpoints: /koi-net/events/broadcast, /koi-net/events/poll, /koi-net/manifests/fetch, /koi-net/bundles/fetch, /koi-net/rids/fetch
  • Octo extensions: /koi-net/handshake, /koi-net/events/confirm, /koi-net/health

Quick federation sanity checks:

# Local node identity and advertised base URL
curl -s http://127.0.0.1:8351/koi-net/health | python3 -m json.tool

# Check edge orientation
docker exec regen-koi-postgres psql -U postgres -d <db_name> -c \
  "SELECT edge_rid, source_node, target_node, status FROM koi_net_edges;"

# Check peer keys
docker exec regen-koi-postgres psql -U postgres -d <db_name> -c \
  "SELECT node_rid, node_name, length(public_key) AS key_len FROM koi_net_nodes;"

Discovery And Peer Selection

Current KOI-net discovery is introduction-based, not automatic gossip/discovery:

  • Nodes discover each other by sharing KOI_BASE_URL + node_rid out-of-band (human coordination, registry docs, trusted intros).
  • Each side verifies identity from /koi-net/health (node_rid, public_key) before creating edges.

How nodes decide who to connect to:

  • Leaf nodes connect to one coordinator for their bioregion.
  • Peer networks connect to a small set of trusted peers with overlapping goals/ontology.
  • Edge rid_types define the exchange scope (principle of least exposure).
  • Prefer explicit trust/governance agreements over broad, automatic peering.

Practical bootstrap pattern:

# Run on each side (or at least on the initiating side)
bash scripts/connect-koi-peer.sh --db <local_db> --peer-url http://<peer-ip>:8351

Multi-Agent Management

bash scripts/manage-agents.sh status   # Health, RAM, PG connections
bash scripts/manage-agents.sh restart  # Restart all agents
bash scripts/test-federation.sh        # End-to-end federation test

Context

Octo is an agent that aims to help the BKC CoIP (Bioregional Knowledge Commons Community of Inquiry & Practice) β€” a collaborative initiative focused on building shared knowledge infrastructure for bioregional organizing worldwide.

The ontology is grounded in:

  • Bollier & Helfrich β€” Free, Fair & Alive (pattern mining from commoning practices)
  • Joel Chan β€” Discourse Graphs (progressive formalization: Question β†’ Claim β†’ Evidence)
  • OpenCivics β€” Protocol/Playbook extension (general patterns + local implementations)
  • SKOS β€” Concept hierarchies (broader/narrower/related)
  • Hyphal Tips β€” Genealogical relationships (forked_from, builds_on, inspired_by)

License

MIT

About

πŸ™ Bioregional Knowledge Commoning Agent β€” AI agent for the Salish Sea built on OpenClaw, with a formal BKC ontology, knowledge graph backend, and discourse graph for progressive formalization

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages