Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/airweave-ai/airweave/sync-architecturegit clone --depth 1 https://github.com/airweave-ai/airweaveWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/airweave-ai/airweave/sync-architecture)<a href="https://agentmods.dev/rules/airweave-ai/airweave/sync-architecture"><img src="https://agentmods.dev/badge/rules/airweave-ai/airweave/sync-architecture.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.04065 |
| Opus 5 | $0.00000 | $0.02032 |
| Sonnet 5 | $0.00000 | $0.00813 |
| Haiku 4.5 | $0.00000 | $0.00407 |
Grade A, and why
sync-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 407 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Airweave Sync Architecture - Deep Dive
Overview
The sync module orchestrates data flow from sources to destinations using a highly concurrent, pull-based asynchronous architecture with sophisticated backpressure control, real-time progress tracking, and automatic OAuth token management.
Core Architecture Principles
1. Pull-Based Concurrency Model
- Worker Pool Pattern: Uses
AsyncWorkerPoolwith semaphore-controlled concurrency (default: 20 workers) - Pull vs Push: Workers pull entities from the stream only when ready, preventing system overload
- Backpressure:
AsyncSourceStreamuses bounded queues (default: 10000) to naturally throttle producers
2. Separation of Concerns
- Producer/Consumer Decoupling: Source generation runs independently from entity processing
- Modular Pipeline: Each stage (enrich, transform, vectorize, persist) is isolated
- Resource Isolation: Database sessions created only when needed to minimize connection usage
Component Deep Dive
SyncFactory
Purpose: Factory that builds SyncContext (data), SyncRuntime (services), and wires them into the orchestrator
Key Responsibilities:
- Builds SyncContext (frozen data) via SyncContextBuilder
- Builds source + cursor directly via
_build_source()(uses SourceLifecycleService) - Builds destinations via DestinationsContextBuilder
- Builds entity tracker via
_build_entity_tracker()(inlined, no separate builder) - Assembles SyncRuntime from per-sync state
- Configures contextual logging with sync metadata
- Wires pipelines, handlers, worker pool, and stream
DI Model: Instance-based with constructor-injected deps. Stateless app-scoped services (event_bus, usage_checker, processor, arf_service) are held by the factory and injected directly into consumers (SyncOrchestrator, EntityPipeline), not stored in SyncRuntime.
SyncContext (frozen data)
Purpose: Immutable data describing a sync run. Inherits from BaseContext (sibling to ApiContext).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 407 lines · 4,065 tokens per session scan A 31be53c18725
sync-architecture is a cursor rule published in the GitHub repository airweave-ai/airweave (6,566 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,065 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
development-phase
开发阶段:以新代码清晰合理为先,兼容仅在零代价时顺带.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.