AD4M is a revolutionary spanning layer that extends the internet stack to enable true collective intelligence in a fully distributed way. Just as TCP/IP created a universal protocol for machines to communicate, AD4M creates a universal protocol for agents (humans and their devices) to make meaning together.
This new layer is needed because:
- The current web is fragmented into data silos and walled gardens
- We lack a universal way to connect meaning across platforms and protocols
- Collective intelligence requires sovereignty and interoperability
- The future of human collaboration needs agent-centric architecture
AD4M solves these challenges by:
- Creating a semantic overlay across all existing protocols
- Enabling any storage or communication method through pluggable Languages
- Treating all data as agent-authored expressions with verifiable provenance
- Building meaning through shared perspectives and social DNA
- Providing a foundation for truly distributed collective intelligence
Think of AD4M as the missing piece in the internet stack – one that transcends mere data exchange to enable meaningful collaboration between sovereign agents, regardless of the underlying protocols or platforms they use.
AD4M represents a sophisticated agent-centric node – a "second brain" that runs on the user's local machine. Unlike traditional web applications that rely on central servers, AD4M puts powerful server capabilities directly in the hands of users:
Each AD4M instance is a full-featured data node that:
- Runs entirely on the user's machine
- Maintains the agent's digital identity and keys
- Stores and manages their semantic data
- Connects to other agents through various protocols
- Acts as their sovereign compute environment
AD4M integrates several powerful technologies into a cohesive whole:
- Holochain: For distributed hash tables and p2p networking
- Deno & V8: For secure JavaScript/TypeScript execution
- Scryer-Prolog: For semantic reasoning and queries
- Juniper: For GraphQL API capabilities
- Kalosm: For AI model inference with Candle
- rustql: For local data persistence
This complexity is necessary to provide a rich, sovereign computing environment – but it's all packaged to run smoothly on personal devices.
AD4M achieves extensibility through a clever self-recursive design:
- The three core concepts (Agents, Languages, Perspectives) are themselves implemented as Languages
- This means the very foundations of AD4M can be extended and evolved
- New implementations of these core Languages can be created and adopted
- The system becomes an evolvable, living network
This architectural pattern enables AD4M to grow into a true "global brain" – a distributed intelligence layer that can adapt and evolve without central coordination.
Languages in AD4M are pluggable protocols that define how information is stored and shared. They create a spanning layer across all existing web protocols and storage systems:
// Languages can wrap any protocol or storage system
const ipfsLanguage = "QmIPFSHash"; // Store on IPFS
const solidLanguage = "QmSolidHash"; // Store on Solid pods
const webLanguage = "https"; // Regular web URLs
// Create and share data through any Language
const expression = await ad4m.expression.create(
{ text: "Hello World!" },
ipfsLanguage
);
// Returns: QmIPFSHash://unique-address
Every piece of data in AD4M is an Expression – a cryptographically signed statement by an agent. This creates a web of verifiable claims rather than "objective" data:
// Expressions are always signed by their author
const expression = await ad4m.expression.get("QmHash123://post789");
console.log(expression);
/* {
author: "did:key:z6Mk...", // Who made this claim
timestamp: "2024-03-21...", // When it was made
data: { text: "Hello!" }, // The actual content
proof: { // Cryptographic proof
signature: "...",
valid: true
}
} */
Perspectives are agent-centric semantic graphs that give meaning to Expressions through links. They enable:
- Personal and shared views of information
- Semantic relationships between any pieces of data
- Collaborative meaning-making in shared spaces
// Create semantic relationships between any expressions
await perspective.add({
source: "did:key:alice", // Subject
predicate: "foaf://knows", // Relationship type
target: "did:key:bob" // Object
});
// Query based on meaning
const friends = await perspective.get({
predicate: "foaf://knows" // Find all friendship links
});
Social DNA defines interaction patterns and social contracts that can be shared and reused across applications. It includes:
- Subject Classes: Define semantic object types
- Flows: Define possible state transitions
- Collections: Define relationship patterns
- Shared semantics for social applications
// Define a reusable social pattern
@ModelOptions({ name: "Post" })
class Post extends Ad4mModel {
@Property({ through: "social://content" })
content: string;
@Collection({ through: "social://comments" })
comments: string[];
@Property({ through: "social://state" })
state: "draft" | "published" | "archived";
}
// Use in any application
const post = await perspective.createSubject(Post);
await post.publish("Hello World!");
These concepts work together to create a new kind of internet – one where meaning flows freely between sovereign agents while maintaining cryptographic verifiability and semantic richness.
- Rust (1.84.0 or later)
rustup install 1.84.0 rustup default 1.84.0 rustup target add wasm32-unknown-unknown
- Go (1.22.0 or later)
# Follow instructions at https://go.dev/doc/install
macOS:
brew install protobuf cmake
Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev \
librsvg2-dev patchelf protobuf-compiler cmake \
fuse libfuse2 mesa-utils mesa-vulkan-drivers \
libsoup-3.0-dev javascriptcoregtk-4.1-dev \
webkit2gtk-4.1-dev librust-alsa-sys-dev
Windows:
choco install strawberryperl protoc cmake curl cygwin gnuwin32-m4 msys2 make mingw
- Clone the repository:
git clone https://github.com/coasys/ad4m.git
cd ad4m
- Install dependencies:
pnpm install
- Build all packages project:
pnpm run build
- Create a UI bundle for the Ad4m Launcher
pnpm run package-ad4m
Find the launcher bundle in /target/release/bundle
.
ad4m/
├── core/ # Core AD4M implementation and TypeScript client
├── rust-executor/ # Rust implementation of the AD4M executor
├── rust-client/ # Rust implementation of the AD4M client
├── executor/ # JavaScript executor implementation
├── bootstrap-languages/ # Core Languages required for AD4M to function
├── cli/ # Command line interface tools
├── connect/ # Library for connecting apps to AD4M
├── dapp/ # DApp server implementation
├── ui/ # Tauri-based system tray application
├── docs/ # Documentation and guides
├── tests/ # Integration tests
└── test-runner/ # Test automation framework
Key Components:
- core: Core types,
Ad4mClient
, and GraphQL schema. Published as@coasys/ad4m
npm package. - rust-executor: Main AD4M executor with GraphQL server, Deno runtime, Holochain integration, AI model inference and Prolog engine.
- rust-client: Rust implementation of
Ad4mClient
. Published asad4m-client
on crates.io. - executor: Core JavaScript code managing agent state, perspectives, languages, and expressions.
- bootstrap-languages: Essential languages for AD4M functionality (like agent identity, language publishing).
- cli: Command line tools for interacting with AD4M. Published as
ad4m
on crates.io. - connect: Helper library for apps to connect to AD4M executors with capability management.
- dapp: UI for blockchain integration through MetaMask.
- ui: System tray application (AD4M Launcher) for managing AD4M executors.
Install the command line tools:
cargo install ad4m
Basic usage:
# Initialize AD4M
ad4m-executor init
# Start the executor
ad4m-executor run
# Create a perspective
ad4m perspectives create
# Query links
ad4m perspectives query-links <uuid>
For a graphical interface, install the AD4M Launcher.
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
npm test
- Submit a pull request
- Discord - Join our community chat
- Twitter - Follow us for updates
- Blog - Read about our vision and progress
AD4M is licensed under the Cryptographic Autonomy License 1.0.
This license ensures:
- The right to run the software
- Access to source code
- The right to modify and distribute
- Protection of user autonomy and data sovereignty
AD4M is developed by Coasys and builds upon ideas from:
- The Semantic Web
- Agent-centric computing
- Holochain
- Solid