Building Cognate Local First AI Planner
Cognate is a local-first, privacy-first AI planner built for people who want intelligent scheduling without giving up control of their data. This article explores the architecture behind Cognate, including its deterministic Rust scheduler, offline-first CRDT synchronization, end-to-end encryption, and cross-platform design.
Building Cognate: Why I Built a Local-First AI Planner That Respects Your Privacy
Most productivity apps have the same weakness—they depend entirely on the cloud.

Your calendar, tasks, notes, and daily plans all live on someone else's servers. If you lose your internet connection, many features stop working. If the service goes down, so does your workflow. And if you want AI-powered planning, you often have to send your entire schedule to an external API.

That trade-off never felt right to me.
I wanted a planner that was fast, intelligent, private, and reliable—even without an internet connection. That idea eventually became Cognate.
Cognate is a local-first AI planner that automatically organizes your day around deadlines, meetings, and priorities while keeping your data on your own device. It doesn't rely on a cloud backend to function, and it doesn't require an AI model to make scheduling decisions.
Instead, it combines deterministic scheduling, offline-first architecture, and end-to-end encryption to create a planner you can actually trust.

The Core Idea
When people hear "AI planner," they usually imagine a chatbot deciding where every task should go.
Cognate takes a different approach.
The AI is there to help—it isn't in charge.
The scheduling engine is completely deterministic and written in Rust. That means if you give it the same tasks, meetings, and constraints, it will always generate the same schedule.
There are no random decisions.
No hidden prompts.
No black-box reasoning.
Even better, every scheduling decision is explainable.
Instead of wondering why a task suddenly appeared at 3 PM, Cognate can tell you something like:
"Scheduled after lunch because your morning already contains two meetings and this task has a deadline tomorrow."
That level of transparency is something many AI-first productivity tools simply don't offer.
AI can still make Cognate smarter by suggesting task breakdowns, estimating durations, or enriching your notes. But if you disconnect from the internet or never configure an API key, the planner continues working exactly as expected.
Making Offline Work Feel Normal
Offline support isn't something I wanted to bolt on later.
It became one of the first architectural decisions.
Every change you make inside Cognate becomes an immutable operation rather than directly modifying data.
Creating a task, completing it, changing a deadline, or editing a title all generate small operations that are stored locally.
These operations are synchronized using Conflict-Free Replicated Data Types (CRDTs), along with Hybrid Logical Clocks and Last-Write-Wins registers.
That might sound complicated, but the user experience is incredibly simple.
You can edit your planner on multiple devices—even while they're offline—and everything merges automatically when they reconnect.
No "Resolve Conflict" dialog.
No duplicated tasks.
No lost edits.
The relay server doesn't understand your data at all. Its only responsibility is storing encrypted operations and forwarding them between devices.
Everything important happens locally.
One Codebase Across Every Platform
Supporting desktop, web, and PWA applications usually means maintaining multiple implementations of the same logic.
I wanted to avoid that.
Cognate keeps almost all of its business logic inside a single platform-independent TypeScript core.
The scheduler, synchronization logic, CRDT implementation, and application state behave exactly the same regardless of where the app runs.
The only thing that changes is the storage layer.
On desktop, Cognate uses SQLite through Tauri.
On the web, it swaps that layer for IndexedDB or browser storage.
This approach dramatically reduces duplicated code and makes behavior consistent everywhere.
Testing Isn't Optional
Building distributed systems is difficult.
Building one that also encrypts everything and works offline is even harder.
That meant testing couldn't be an afterthought.
Cognate follows a strict testing strategy that covers every layer of the application.
Unit and property-based tests validate scheduler behavior, cryptographic functions, CRDT merging, and permission handling across hundreds of scenarios.
End-to-end Playwright tests simulate complete user workflows, including synchronization across multiple devices.
The Rust backend and relay server are also covered with dedicated cargo tests.
It's a significant investment, but it makes adding new features much less risky.
Privacy Isn't a Feature—It's Part of the Architecture
Many applications advertise privacy because they encrypt data while it's sitting on their servers.
Cognate takes a different approach.
Your data is encrypted before it ever leaves your device.
During setup, your passphrase derives an AES-GCM encryption key along with an opaque room identifier.
Every operation generated by the synchronization engine is encrypted locally.
Each operation is also signed using ECDSA P-256 so other devices can verify that it genuinely came from you.
If someone compromises the relay server, they don't gain access to your tasks.
They see encrypted blobs.
They can't read them.
They can't modify them.
They can't forge new operations.
Even the room identifiers reveal nothing about who owns the data.
For collaborative work, sharing access is essentially sharing cryptographic trust—not giving another company visibility into your information.
Performance Comes From Staying Local
Because almost everything happens on your own machine, Cognate feels responsive.
Current benchmarks look roughly like this:
Scheduling 100 tasks takes around 14 ms
Re-planning after interruptions takes roughly 7 ms
Cold startup finishes in about 180 ms
Encryption adds less than 1 ms per operation
Those numbers aren't achieved through expensive cloud infrastructure.
They're possible because the planner doesn't need to wait for network requests before doing useful work.
You can plan your day on an airplane, inside a train tunnel, or anywhere without internet.
Once you're back online, your devices quietly synchronize in the background.
Why I Built Cognate
The goal wasn't just to build another task manager.
I wanted to challenge the assumption that intelligent software has to depend on the cloud.
Modern hardware is already powerful enough to schedule tasks, synchronize data, encrypt information, and even run local AI models.
We shouldn't have to sacrifice ownership of our data just to get a smarter planner.
Cognate is my attempt to prove that privacy, speed, explainability, and intelligent automation can all exist together.
Your schedule belongs to you.
Your data belongs to you.
And your planner should keep working whether the internet does or not.
Cognate is open source, and I'm actively building it in public. If you'd like to explore the project, contribute, or follow its progress, check out the GitHub repository and architecture documentation.
I'd love to hear your feedback and ideas as the project continues to evolve.

