Your First Chat
This guide walks through starting Lattice and having your first conversation with an AI agent.
Time required: ~10 minutes Prerequisites: macOS 13+ on Apple silicon, or Linux (Ubuntu 20.04+)
Step 1: Install and Start#
Install the Lattice runtime:
# macOS and Linux
curl -fsSL https://d.uselovelace.com/lattice | sh
Start the daemon:
lattice-ctl daemon start
Verify it's running:
lattice-ctl ping
You should see a successful response.
Step 2: Configure a Provider#
You need an LLM provider to chat. Choose one:
Option 1: Anthropic Claude (Easiest)#
ada config provider set anthropic \
--api-key sk-your-api-key-here \
--model claude-sonnet-5
Get your API key from console.anthropic.com.
Option 2: OpenAI#
ada config provider set openai \
--api-key sk-your-openai-key-here \
--model gpt-4
Option 3: Local Model (Free, Private)#
Install Ollama from ollama.ai:
# Pull a model
ollama pull mistral
# Configure Lattice
ada config provider set ollama \
--base-url http://localhost:11434 \
--model mistral
Step 3: Start Your First Chat#
Start an interactive conversation:
ada chat
You'll see a prompt:
You:
Type your message:
You: What is lattice and how does it work?
Press Enter. The AI will stream the response:
Assistant: Lattice is a personal AI infrastructure running on your machine.
It consists of a background daemon that manages agents, sessions, and LLM provider
connections. All your data stays on your machine in a local database...
Type more messages to continue the conversation:
You: How is it different from cloud AI?
Assistant: The main differences are...
Exit the conversation:
You: exit
or
You: quit
Your conversation is automatically saved.
Step 4: View Your Sessions#
See all your saved conversations:
ada sessions list
Output:
ID Type Title Created
────────────────────────────────────────────────────
session_abc123 chat Chat Session 2024-12-22T10:30:00Z
session_def456 chat Chat Session 2024-12-22T10:35:00Z
Step 5: Resume Your Session#
Continue a previous conversation:
# Resume the last session
ada sessions resume
# Or resume a specific session
ada sessions resume session_abc123
The full conversation history is there. The AI remembers what you discussed.
Step 6: Manage Sessions#
Get session details#
ada sessions info session_abc123
Delete a session#
ada sessions delete session_abc123
Understanding What Just Happened#
The Flow#
1. You type: ada chat
↓
2. CLI connects to daemon via Unix socket
↓
3. Daemon creates a new session
(Session ID generated, stored in SQLite)
↓
4. You type a message
↓
5. Message sent to configured LLM provider
(via Anthropic API, OpenAI API, or local Ollama)
↓
6. Provider generates response tokens
↓
7. Response streamed back to terminal
↓
8. Entire conversation saved to local database
↓
9. You exit chat
Data Flow#
Terminal Input
↓
Ada CLI
↓
Unix Socket
↓
Lattice Daemon
├─ Session Manager (creates/resumes session)
├─ LLM Router (sends to configured provider)
└─ Storage (saves to SQLite)
↓
LLM Provider (Anthropic, OpenAI, or Ollama)
↓
Response back through daemon to terminal
↓
Local SQLite Database (conversation persisted)
What Gets Stored Locally#
All conversations are stored in your local SQLite database at ~/.lovelace/lattice/:
~/.lovelace/lattice/
├── lattice.db
│ ├── sessions table
│ │ ├── session_abc123 (your conversation)
│ │ └── session_def456 (another conversation)
│ └── messages table
│ ├── your messages
│ └── assistant responses
└── config.toml (your provider settings)
Nothing leaves your machine unless you explicitly configure cloud sync (not enabled by default).
Common Tasks#
Switch Providers#
List configured providers:
ada config provider list
Activate a different one:
ada config provider activate ollama
Chat will now use Ollama instead of your previous provider.
Test a Provider#
Make sure your provider is working:
ada config provider test
or test a specific one:
ada config provider test openai
Check Your Configuration#
See what's configured:
ada config show
API keys are hidden by default. To see them:
ada config show --show-secrets
View Your Chat History#
Sessions store all your messages. To see the last session's details:
ada sessions list
Then:
ada sessions info <session-id>
Troubleshooting#
"No provider configured" error#
You skipped Step 2. Configure a provider:
ada config provider set anthropic --api-key sk-...
"Connection refused"#
The daemon isn't running:
lattice-ctl daemon start
"API key invalid"#
Your provider API key is wrong. Reconfigure:
ada config provider set anthropic --api-key sk-your-correct-key
Then test it:
ada config provider test anthropic
Chat seems slow#
If using a local model (Ollama):
- Make sure
ollamais running:ollama serve - Check the model is available:
ollama list - Model inference takes time on CPU (faster on GPU)
If using cloud provider:
- Check your internet connection
- Verify the API key is valid
Chat exits unexpectedly#
This can happen with certain terminal configurations. Try:
ada chat --no-daemon
This runs the chat without using the daemon (connects directly to your provider).
Next Steps#
Now that you've had your first chat:
- Configure More Providers → - Add multiple LLM providers
- Manage Agents → - Learn about autonomous agents
- Understand Privacy → - How your data is handled
- Full Installation Guide → - Platform-specific details
Key Takeaways#
Sessions are persistent - Conversations are saved and can be resumed
Providers are flexible - Switch between cloud and local models
Everything stays local - No cloud sync by default
The daemon does the work - CLI is just a client interface
Data is in SQLite - Stored in ~/.lovelace/lattice/lattice.db