What is Lattice?
How the daemon and the gateway work together: Lattice is the daemon that runs on your device, managing agents, sessions, and LLM provider connections locally. Pair several devices with one Lovelace account and they act as one network. Lattice Cloud is the hosted gateway that apps call: it routes each request to a paired device or, when fallback is on, to Lovelace-hosted capacity. You can use the daemon on its own without the gateway.
The Mental Model#
Think of Lattice as your personal AI infrastructure running on your machine—everything you'd get from a cloud AI platform, but running entirely on your machine.
Just like how a laptop gives you computing power without renting server space, Lattice gives you an AI agent platform without renting cloud services. You own the infrastructure, the data, and the models.
Three Core Principles#
1. Local-First#
By default, everything happens on your machine:
- Your data stays local in SQLite
- Your agents run locally
- Your sessions are stored locally
- Cloud features are optional add-ons
You explicitly choose what leaves your machine.
2. Daemon-Based#
Lattice runs as a background service (daemon) that:
- Manages all agents and sessions
- Handles LLM provider connections
- Stores data in local SQLite database
- Communicates with clients via Unix sockets
This is why agents can keep running even if you close your terminal.
3. Provider Flexibility#
You choose which LLM providers to use:
- Local models: Ollama, LM Studio (free, private)
- Cloud models: Anthropic Claude, OpenAI, Google Gemini
- Multiple providers: Switch between them on the fly
Same agent code works with any provider.
Key Concepts#
Daemon#
The background process running on your machine. It:
- Listens for commands from the Ada CLI
- Manages agents and sessions
- Routes to configured LLM providers
- Stores data in SQLite
- Communicates via Unix sockets
Start it with:
lattice-ctl daemon start
Agents#
Autonomous AI workers that execute tasks you assign:
ada agents start "Analyze my code and find issues"
Agent runs in background, you can:
- Check status:
ada agents status <agent-id> - Stop it:
ada agents stop <agent-id> - View results: stored in local database
Sessions#
Chat conversation history with context:
ada chat # Create new session
# [conversation happens]
# Session saved automatically
ada sessions list # See all sessions
ada sessions resume <session-id> # Continue a conversation
Sessions remember context, so the AI understands your previous messages.
Providers#
LLM services you configure:
# Anthropic Claude
ada config provider set anthropic --api-key sk-...
# OpenAI
ada config provider set openai --api-key sk-...
# Ollama (local)
ada config provider set ollama --base-url http://localhost:11434
Agents and sessions use the active provider automatically.
How It Works: The Stack#
Data stays local in the daemon's SQLite database unless you explicitly configure cloud sync.
Why Daemon-Based?#
You might wonder: "Why not just run agents directly?"
The daemon solves real problems:
- Persistence - Agents keep running even if you close your terminal
- Session management - Conversations survive computer restarts
- Multiple clients - Multiple CLI instances share the same agents
- Resource efficiency - One daemon, one connection to each LLM provider
- Background execution - Agents work while you do other things
Without a daemon, each terminal would create its own agent, wasting resources.
Agents vs Sessions: Key Difference#
| Aspect | Agents | Sessions |
|---|---|---|
| Purpose | Autonomous workers executing tasks | Interactive conversations |
| How created | ada agents start <TASK> | ada chat |
| Execution | Background, runs to completion | Interactive, user-driven |
| Interaction | Check status, stop, view results | Type messages, get responses |
| Use case | Analysis, automation, batch work | Real-time conversation |
Example:
Agents: "Analyze all my files and generate a report" (runs in background)
Sessions: "Let's chat about my code" (interactive back-and-forth)
Privacy and Data#
What Stays Local#
- All agent data
- All conversation history
- All session data
- Configuration files
- Your LLM provider credentials (stored encrypted)
What Can Go to Cloud#
- Optionally: Backed-up sessions (if enabled)
- Optionally: Synced agent data (if enabled)
- Never: Credentials (API keys, tokens)
You explicitly enable cloud sync; it's off by default.
What Goes to LLM Providers#
Only what you send to them:
- Your task/message (goes to provider)
- Provider response (comes back to you)
- Everything else (your files, other conversations, system data) - stays local
Offline Capability#
With local models (Ollama):
# No internet needed
ollama pull mistral
ada config provider set ollama --base-url http://localhost:11434
ada agents start "Analyze this locally" # Works offline
With cloud models:
- Need internet to call the API
- But all results stored locally
- Can browse local history offline
Comparing to Alternatives#
Traditional Cloud Platform#
Lattice (Local-First)#
Philosophy: Ownership and Simplicity#
Lattice is built on two principles:
-
You own your infrastructure
- Not locked into a vendor
- Can migrate or stop using lattice anytime
- Data export/import fully supported
- Make privacy decisions yourself
-
Simple beats complex
- One daemon per machine
- No distributed systems complexity
- Direct Unix socket communication
- SQLite for storage (proven, reliable)
When Lattice is Right#
Perfect For:#
- Privacy work - Healthcare, legal, financial, research
- Offline development - No internet required
- Cost-sensitive - No per-API-call charges for local models
- Learning - Experiment without subscriptions
- Control - Full infrastructure ownership
Consider Platform Services For:#
- Team collaboration - Shared workspaces (Lovelace platform)
- Managed compute - Distributed inference without managing hardware (Lattice Cloud)
- High compute - Need more power than your machine (Lattice Cloud)
- Scaling - Distributed agent execution at scale
Or Use Both:#
- Develop locally, sync to cloud for team
- Run private agents locally, share results
- Use local models for privacy, cloud for power
Your Devices as One Network#
Pair more than one device with the same Lovelace account, up to 5 per account.
Run ada pair on a new device and approve it from a device you already trust.
Pairing goes through the Lovelace relay. After that, a request can run on any
paired device that is online.
ada devices list
ada devices info <device-id>
ada devices remove <device-id>
When no paired device can take an untargeted request and fallback is on, the hosted gateway runs it on Lovelace-hosted capacity.
Not Available Yet#
- Direct device-to-device connections that skip the Lovelace relay
- A marketplace of compute from other people
Key Takeaways#
Lattice is your personal AI infrastructure Data stays local by default Works offline with local models Daemon manages agents and sessions You control which providers to use Simple, proven architecture (SQLite + Unix sockets) Designed for privacy-first applications
Next Steps#
- Quickstart → - Get lattice running
- Agents and Tasks → - Understand agents
- Architecture → - Deep dive on system design
- Privacy → - Data handling details