Skip to main content

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+, Linux (Ubuntu 20.04+), or Windows 10+

Step 1: Install and Start

Install Lattice:

bash
# macOS and Linux
curl -fsSL https://uselovelace.com/lattice/install.sh | sh

# Windows (PowerShell as Administrator)
irm https://uselovelace.com/lattice/install.ps1 | iex

Start the daemon:

bash
lattice-ctl daemon start

Verify it's running:

bash
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)

bash
ada config provider set anthropic \
  --api-key sk-your-api-key-here \
  --model claude-sonnet-4-6

Get your API key from console.anthropic.com.

Option 2: OpenAI

bash
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:

bash
# 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:

bash
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:

bash
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:

bash
# 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

bash
ada sessions info session_abc123

Delete a session

bash
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:

bash
ada config provider list

Activate a different one:

bash
ada config provider activate ollama

Chat will now use Ollama instead of your previous provider.

Test a Provider

Make sure your provider is working:

bash
ada config provider test

or test a specific one:

bash
ada config provider test openai

Check Your Configuration

See what's configured:

bash
ada config show

API keys are hidden by default. To see them:

bash
ada config show --show-secrets

View Your Chat History

Sessions store all your messages. To see the last session's details:

bash
ada sessions list

Then:

bash
ada sessions info <session-id>

Troubleshooting

"No provider configured" error

You skipped Step 2. Configure a provider:

bash
ada config provider set anthropic --api-key sk-...

"Connection refused"

The daemon isn't running:

bash
lattice-ctl daemon start

"API key invalid"

Your provider API key is wrong. Reconfigure:

bash
ada config provider set anthropic --api-key sk-your-correct-key

Then test it:

bash
ada config provider test anthropic

Chat seems slow

If using a local model (Ollama):

  • Make sure ollama is 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:

bash
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:

  1. Configure More Providers → - Add multiple LLM providers
  2. Manage Agents → - Learn about autonomous agents
  3. Understand Privacy → - How your data is handled
  4. 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