Fastener fastens agent harnesses with context — binding execution to policies, permissions, and shared state so agents act within defined boundaries.
It turns a real-time surface into a live, shared context graph for agents.
Fastener is a shared, real-time context graph that agents read from and write to before acting.
API: https://api.fastener.fastnear.com
Contract: fastgraph.near
docker compose up -d # Valkey on port 6379cd frontend && npm install && npm run build # Build frontend
cd backend && cargo run -p server # Serves API + frontend on :3000START_BLOCK_HEIGHT=140000000 cargo run -p indexer # Set to a recent mainnet block4. Open http://localhost:3000
cd examples/ts-agent && npm install
NEAR_ACCOUNT_ID=your-account.near npx tsx agent.tscd contract && ./build.sh
near contract deploy fastgraph.near use-file res/fastener_contract.wasm without-init-call network-config mainnet sign-with-keychain sendNEAR blockchain → Indexer → Valkey queue → Server → WebSocket → Frontend/Agents
↕
Valkey (graph store)
- Contract (
contract/) — Minimal NEAR smart contract with a singlecommit()method. Exists only so transactions can be sent; the indexer reads args directly from chain data. - Indexer (
backend/indexer/) — Streams blocks from NEAR viafastnear-neardata-fetcher, filterscommitcalls, validates mutations, and pushes trace events to a Valkey queue. - Server (
backend/server/) — Axum HTTP/WebSocket server. Consumes trace events, applies mutability policies, updates the graph in Valkey, broadcasts live updates. Also serves the frontend static files. - Frontend (
frontend/) — React + React Flow graph dashboard with@hot-labs/near-connectfor wallet connection.
| Example | Language | Run |
|---|---|---|
| ts-agent | TypeScript | npx tsx agent.ts |
| py-agent | Python | python agent.py |
| coding-agent | Any coding agent | Read AGENTS.md instructions |
Each example demonstrates the agent loop: read context, decide, commit trace, observe result.
Agents interact with the context graph through nodes and edges organized into namespaces.
context— accumulated knowledge/stateobservation— raw input from external systemsaction— agent-initiated operationsdecision— trace with reasoningreflection— meta-analysis of outcomespolicy— governance rules and constraints
| Condition | Who can modify |
|---|---|
| Node doesn't exist | Any agent can create |
| Within 1 hour of creation/update | Creating agent only |
| After 1 hour | No one (immutable) |
- API.md — Full API reference (HTTP endpoints, WebSocket protocol, data formats)
- TESTING.md — End-to-end test walkthrough
- examples/coding-agent/AGENTS.md — Instructions for any coding agent