Skip to content

Revision: 2026-04-06

AI Chat Mode

Interactive streaming conversation with Deposium AI. Chat streams are routed via the Edge Runtime gateway (auth + rate-limiting) by default.

How It Works

The chat system maintains a conversation history and provides context from recent messages to the AI with each new query. This allows the AI to:

  • Remember previous questions and answers
  • Build upon earlier context
  • Provide more coherent multi-turn conversations

Usage

The easiest way to chat with the AI - a dedicated chat interface:

deposium chat

Options:

  • --direct — Bypass Edge Runtime, connect directly to MCP server (dev only)

This opens a continuous chat interface where you can:

  • Type messages continuously without returning to menus
  • Use /exit to quit
  • Use /clear to clear conversation history
  • Use /history to view past messages

Edge Runtime Routing

By default, chat streams route through the Edge Runtime gateway which provides:

  • Authentication (API key validation via SHA-256)
  • Rate limiting (free: 60/min, pro: 300/min, enterprise: 1000/min)
  • SSE proxy to the MCP backend

For local development, use --direct to bypass the gateway:

deposium chat --direct

Example:

💬 Deposium AI Chat

Chat with AI continuously. Commands:
  /exit    - Exit chat
  /clear   - Clear conversation history
  /history - View conversation history

? You: What is TypeScript?
🤖 AI:
[AI explains TypeScript...]

[0.5 exchanges]

? You: How does it differ from JavaScript?
🤖 AI:
[AI explains differences with context from previous question...]

[1 exchanges]

? You: /exit
👋 Goodbye!

Interactive Mode (Menu-based)

When using deposium interactive and selecting Compound AI:

  1. First prompt: Just ask your question normally
  2. Subsequent prompts: The AI will have context from previous messages
  3. View history: When prompted, choose "Yes" to view conversation history
  4. Clear history: Choose "Yes" when asked if you want to clear history to start fresh

Example flow:

? Enter your question: What is TypeScript?
[AI responds with explanation]
💬 2 messages in conversation

? Enter your question: How does it differ from JavaScript?
[AI responds with context from previous question]
💬 4 messages in conversation

Command Line Mode

The standalone deposium compound analyze command is one-shot — each invocation is a fresh process and does not carry conversation history across calls. For multi-turn conversations with persistent history, use the REPL via deposium chat or deposium interactive.

deposium compound analyze "What is TypeScript?"
deposium compound analyze "How does it differ from JavaScript?"  # independent process, no shared context

Features

Message History

The deposium chat REPL keeps up to 10 messages (user + assistant) in memory for the duration of the session and sends the 6 most recent to the backend as context.

Context Awareness

Each message sent to the AI from the REPL includes:

User: [previous question]
Assistant: [previous answer]
User: [previous question]
Assistant: [previous answer]
User: [current question]

This allows the AI to understand:

  • What you asked before
  • What it already explained
  • How the current question relates to previous ones

Example Conversation

$ deposium chat
> Explain neural networks
[AI explains neural networks]

> How would I implement one in Python?
[AI provides Python code, knowing you want a neural network]

> What libraries would make this easier?
[AI suggests TensorFlow/PyTorch, knowing the prior context]

Technical Details

  • Storage: In-memory (resets when CLI exits)
  • Max messages: 10 total messages
  • Context window: 6 most recent messages sent to backend
  • Streaming: SSE via Edge Runtime (/chat-stream) or direct MCP (/api/chat-stream)
  • Rate limiting: 429 responses display Retry-After and tier info

Tips

  1. Use clear history when switching topics completely
  2. View history if you forgot what you asked earlier
  3. Build gradually - ask follow-up questions to dive deeper
  4. Stay on topic - context works best for related questions

Future Enhancements

Potential improvements:

  • Persistent storage (save conversations between sessions)
  • Named conversations (switch between multiple conversation threads)
  • Export conversations to files
  • Configurable history length
  • Token-based context management instead of message count