Common Use Cases for Macro: How Teams Leverage This All‑In‑One Rust Workspace
Macro combines email, chat, docs, tasks, agents, calls, file storage, GitHub pull requests, and a native CRM into a single Rust‑backed workspace where every entity can be @‑mentioned from any other.
Teams use Macro to eliminate context switching between specialized tools. Its architecture—a Cargo workspace with approximately 80 crates, 42 services, and TypeScript SDK packages—stores all data in a shared PostgreSQL database (MacroDB) and links entities through a bidirectional graph. This design enables powerful cross‑entity workflows that would require multiple integrations in traditional stacks.
Below are the ten most common use cases teams implement with Macro, each grounded in specific architectural components from the macro‑inc/macro repository.
Unified Email Inbox with Keyboard‑First Navigation
Teams consolidate multiple Gmail accounts into one searchable, keyboard‑driven inbox that surfaces related tasks, messages, and AI suggestions alongside each thread.
The Email block implements this through services/email_service (handling inbound/outbound mail) and the email_db_client crate for persistence. Messages are stored in MacroDB with full‑text indexing, enabling the graph to link emails to tasks, docs, or CRM records via @‑mentions.
Key implementation: services/email_service/src/lib.rs handles IMAP/SMTP operations and writes normalized messages to the shared schema.
Focused Team Chat with Entity Cross‑References
Channels and direct messages support threaded, permission‑aware conversations where any message can reference files, tasks, and CRM records through the same @‑mention system.
The Messages block combines services/connection_gateway (WebSocket infrastructure) with crates/chat (domain models and business logic). When you type @contact_42 in a message, the create_message function in macro_db_client simultaneously inserts the text and creates bidirectional entries in the entity_mentions table.
Example in Rust:
use macro_db_client::pool::PgPool;
use crates::chat::model::Message;
#[tokio::main]
async fn main() {
let db = PgPool::connect("postgres://...").await.unwrap();
let msg = Message::new(
"Hey @contact_42, can you review the contract?",
"channel_99",
Some("user_7"),
);
macro_db_client::chat::create_message(&db, &msg).await.unwrap();
}
The UI navigates from chat to contact profile instantly through this graph linkage.
Task Management Born from Context
Tasks in Macro are rarely created in isolation. Teams generate them from emails, document selections, channel messages, or pull requests—with automatic back‑links to the source context.
The Tasks block leverages services/document_cognition_service (extraction and linking logic) and crates/notification_db_client (persistence layer). When you create a task from an email, the service records bidirectional links in the graph, letting you view the task from the email thread and vice versa.
TypeScript SDK example:
import { Macro } from '@macro/sdk';
const macro = new Macro({}); // API key from MACRO_API_KEY env var
const email = await macro.email.getMessage({ id: 'mail_12345' });
await macro.tasks.create({
title: 'Follow up with client',
description: `Refer to ${email.threadUrl} for context`,
assigneeId: 'user_67890',
});
The SDK automatically adds the @‑link, so both entities display their relationship in the UI.
Live Collaborative Documents with CRDTs
Real‑time markdown documents support simultaneous editing through conflict‑free replicated data types (CRDTs), with @‑mentions that resolve to any entity in the system.
The Docs block lives in apps/web/src/lib/features/doc/ (frontend editor) and crates/loro-mirror (Rust‑backed CRDT synchronization). Document state converges across clients without server coordination, while mentions trigger the same graph insertions as chat messages.
Visual Planning with the 2‑D Canvas
Teams use Macro's canvas as a spatial workspace where tasks, emails, code snippets, and CRM objects can be arranged visually—all maintaining their underlying @‑mention relationships.
The Canvas block is implemented in apps/web/src/features/canvas/. Each embedded object is a view onto the underlying graph node, so updates in one representation (canvas card vs. email thread) propagate everywhere.
AI Agents with Full Graph Access
Macro agents aren't confined to single channels. They have read‑write access to the entire entity graph, execute automated workflows, and expose an MCP (Model Context Protocol) surface for external models.
The Agents block spans packages/sdk (TypeScript interface for agent development) and crates/anthropic (example LLM integration). Agents query any service and create entities that participate fully in cross‑reference workflows.
Example agent that processes invoices:
import { Macro } from '@macro/sdk';
const macro = new Macro({});
async function invoiceReminder() {
const recent = await macro.email.search({ query: 'invoice' });
for (const mail of recent) {
await macro.tasks.create({
title: `Process invoice ${mail.subject}`,
description: `Found in ${mail.threadUrl}`,
assigneeId: mail.fromUserId,
});
}
}
invoiceReminder();
Because Email and Tasks share the graph, created tasks automatically link to source emails.
Integrated Calls with Searchable Transcripts
Voice and video calls are recorded, transcribed, and stored as entities that can be @‑mentioned from messages, docs, and tasks.
The Calls block reuses services/connection_gateway for WebRTC media streams. Transcripts become first‑class documents in the graph, searchable alongside emails and files.
File Storage with Cross‑Entity Attachment
Files attached anywhere—emails, messages, docs—are stored in S3 and indexed in OpenSearch for unified search, with attachment relationships visible through the graph.
The File storage block combines services/static_file_service (upload/download handling) and crates/opensearch_client (full‑text indexing). Permission inheritance follows the containing entity's channel membership.
GitHub Pull Request Integration
Pull requests appear as linkable objects in channels and docs, enabling code review discussions inside Macro's unified interface without context switching to GitHub.
The Pull‑request block uses services/document_storage_service (metadata persistence) and crates/mcp_client (GitHub API interaction). PRs participate in @‑mention workflows alongside native Macro entities.
Native CRM with Automatic Activity Capture
Companies, contacts, and deals live as first‑class graph nodes that can be @‑mentioned from any block. CRM records stay current because every mention creates a relationship record.
The CRM block is implemented through crates/comms_db_client and crates/email_db_client, sharing the same schema as messages and tasks. When you mention a contact in a task or document, that activity appears in the contact's timeline automatically.
How the Bidirectional Graph Enables Everything
All ten use cases depend on Macro's bidirectional graph architecture. The macro_db_client crate (crates/macro_db_client/src/lib.rs) defines this shared schema and entity‑mention logic:
- Every entity type (email, task, contact, file, etc.) has a unique node ID
- @‑mentions create entries in
entity_mentionslinking source and target - Queries traverse these relationships in either direction with single‑index lookups
- Permission checks join against channel membership tables before returning results
This design means a task created from an email doesn't just store a foreign key—it becomes a traversable relationship where the email UI can display "linked tasks" and the task UI shows "source email" without additional query complexity.
Summary
- Macro unifies email, chat, docs, tasks, agents, calls, files, pull requests, and CRM in one Rust‑backed workspace with ~80 crates and 42 services
- Every entity is @‑mentionable from any other through a bidirectional graph stored in MacroDB
- Cross‑entity workflows (task from email, CRM mention in chat) happen without integrations because blocks share the same database and graph layer
- Key architectural files:
services/email_service/src/lib.rs,services/connection_gateway/src/lib.rs,crates/macro_db_client/src/lib.rs, andpackages/sdk/README.mddemonstrate the microservice patterns enabling these use cases - Both Rust and TypeScript SDKs expose these capabilities, with the TypeScript SDK installing from
@macro/sdk
Frequently Asked Questions
How does Macro differ from Slack connected to Gmail?
Slack integrations pass messages between separate systems. Macro stores email, chat, and all other data in one PostgreSQL database (MacroDB) with unified entity relationships. When you @‑mention a CRM contact in a chat message, Macro creates a native graph link—not a URL unfurl—enabling bidirectional navigation and automatic activity timeline updates.
Can I build custom agents that access multiple Macro services?
Yes. The @macro/sdk TypeScript package and Rust crates like crates/anthropic provide full read‑write access to the entity graph. Agents can query emails, create tasks, update CRM records, and post messages, with all actions participating in the same @‑mention and permission systems as user operations.
What database schema enables the @‑mention functionality?
The macro_db_client crate defines tables for each entity type plus an entity_mentions junction table recording source‑target relationships. This schema lives in crates/macro_db_client/src/lib.rs and is shared across all 42 services, ensuring consistent graph semantics whether you're mentioning from chat, docs, or canvas.
Is Macro's document editor based on Operational Transformation or CRDTs?
CRDTs. The Docs block uses crates/loro-mirror for Rust‑native CRDT synchronization, implemented in apps/web/src/lib/features/doc/. This enables real‑time collaboration without server coordination for conflict resolution, while still integrating with Macro's graph for @‑mention functionality.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →