tutorial

Monitoring Cheshire Cat AI with Vigilmon

Cheshire Cat AI is a self-hosted conversational AI framework with plugins, long-term memory, and multi-LLM support — but it has no built-in uptime alerting. Here's how to monitor the FastAPI server, WebSocket chat endpoint, vector memory, and LLM provider connectivity with Vigilmon.

Cheshire Cat AI gives teams a fully customizable AI assistant with long-term memory, plugin architecture, and support for OpenAI, Anthropic, Ollama, and more — all self-hosted. It sits as a middleware layer between users and LLMs, making AI behavior programmable without fine-tuning. But when any component fails — the FastAPI server, the vector memory database, the LLM provider, or a plugin — connected clients lose AI service entirely. Vigilmon gives you uptime monitoring, WebSocket endpoint checks, and SSL certificate alerts so you catch Cheshire Cat failures before your users do.

What You'll Set Up

  • HTTP uptime monitor for the FastAPI server (port 1865)
  • WebSocket chat endpoint health check
  • LLM provider connectivity monitor (OpenAI / Anthropic / Ollama)
  • Vector memory database health check (Qdrant / Chroma)
  • Database connectivity monitor (PostgreSQL / SQLite)
  • Admin panel availability check
  • Memory ingestion API health monitor
  • SSL certificate expiry alerts

Prerequisites

  • Cheshire Cat AI running (Docker Compose or direct Python install) on port 1865
  • Admin access to the Cat dashboard
  • A free Vigilmon account

Step 1: Monitor the FastAPI Server

The Cheshire Cat core API is a FastAPI application running on port 1865. If it's down, all connected clients immediately lose AI service — there's no fallback.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the Cat API URL: http://your-server:1865/ (or your reverse-proxied HTTPS URL).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

Cheshire Cat exposes a root endpoint that returns the Cat's status. You can also target the dedicated health endpoint if your version supports it:

http://your-server:1865/health

The health endpoint returns a JSON response confirming the Cat is running and its core services are initialized. If the FastAPI process crashes or the port becomes unreachable, your monitor fires immediately.


Step 2: Monitor the WebSocket Chat Endpoint

The primary interface for Cheshire Cat is a WebSocket connection at ws://host:1865/ws/:user_id. Every real-time chat session uses this endpoint — if it's broken, users see connection errors even though the HTTP API may still appear healthy.

Since standard HTTP monitors can't test WebSocket handshakes, use a heartbeat script that performs a real WebSocket connection:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 3 minutes.
  3. Copy the heartbeat URL (e.g., https://vigilmon.online/heartbeat/abc123).
  4. Create a WebSocket health check script:
#!/usr/bin/env python3
# check-cat-websocket.py
# Requires: pip install websocket-client requests

import websocket
import json
import requests
import threading

HEARTBEAT_URL = 'https://vigilmon.online/heartbeat/abc123'
CAT_WS_URL = 'ws://your-server:1865/ws/health-check-user'

def check_websocket():
    connected = threading.Event()
    
    def on_open(ws):
        # Send a simple ping message
        ws.send(json.dumps({'text': 'ping'}))
    
    def on_message(ws, message):
        connected.set()
        ws.close()
    
    def on_error(ws, error):
        ws.close()
    
    ws = websocket.WebSocketApp(
        CAT_WS_URL,
        on_open=on_open,
        on_message=on_message,
        on_error=on_error
    )
    
    t = threading.Thread(target=lambda: ws.run_forever())
    t.daemon = True
    t.start()
    
    # Wait up to 10 seconds for a response
    if connected.wait(timeout=10):
        requests.get(HEARTBEAT_URL, timeout=5)
    # If no response, heartbeat not sent — Vigilmon will alert

check_websocket()

Schedule this every 3 minutes:

*/3 * * * * /usr/bin/python3 /opt/cheshire-cat/check-cat-websocket.py

Step 3: Monitor LLM Provider Connectivity

Cheshire Cat relays every user message to a configured LLM backend. If that backend is unreachable — whether it's the OpenAI API, Anthropic API, or a local Ollama instance — the Cat returns errors for every chat request.

For OpenAI:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter https://api.openai.com/.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 5 minutes.
  5. Click Save.

For Anthropic:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter https://api.anthropic.com/.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 5 minutes.

For self-hosted Ollama:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter http://your-ollama-host:11434/.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 1 minute.

For a more meaningful check of your specific configured model, wrap the Ollama generate endpoint:

import requests

def check_ollama():
    try:
        resp = requests.post(
            'http://your-ollama-host:11434/api/generate',
            json={'model': 'llama3', 'prompt': 'ping', 'stream': False},
            timeout=15
        )
        if resp.status_code == 200:
            requests.get('https://vigilmon.online/heartbeat/ollama123', timeout=5)
    except Exception:
        pass

Step 4: Monitor the Vector Memory Database

Cheshire Cat's long-term memory uses a vector database — either Qdrant (default) or Chroma — to store episodic memory, declarative memory, and procedural memory. If the vector store goes down, the Cat loses all memory retrieval capability and RAG-based responses degrade or fail entirely.

For Qdrant:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter http://your-qdrant-host:6333/health.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 1 minute.
  5. Click Save.

The Qdrant health endpoint returns {"title":"qdrant - vector search engine","version":"..."} when healthy.

For Chroma:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter http://your-chroma-host:8000/api/v1/heartbeat.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 1 minute.

For a deeper check that verifies memory read/write operations are working:

from qdrant_client import QdrantClient
import requests

def check_qdrant_operations():
    try:
        client = QdrantClient(host='your-qdrant-host', port=6333)
        collections = client.get_collections()
        # Verify the Cat's memory collections exist
        collection_names = [c.name for c in collections.collections]
        if 'episodic' in collection_names and 'declarative' in collection_names:
            requests.get('https://vigilmon.online/heartbeat/qdrant123', timeout=5)
    except Exception:
        pass

Step 5: Monitor Database Connectivity

Cheshire Cat stores conversation history and configuration in PostgreSQL (in server deployments) or SQLite. Database connectivity loss means conversation history can't be persisted and settings may not load correctly on restart.

For PostgreSQL:

  1. Click Add MonitorTCP Port.
  2. Enter your PostgreSQL host.
  3. Set Port to 5432.
  4. Set Check interval to 1 minute.
  5. Click Save.

For a deeper application-level check, add a health endpoint to a companion service:

from fastapi import FastAPI
from sqlalchemy import create_engine, text

app = FastAPI()

@app.get('/db-health')
def db_health():
    engine = create_engine('postgresql://user:pass@host/catdb')
    try:
        with engine.connect() as conn:
            conn.execute(text('SELECT 1'))
        return {'status': 'ok'}
    except Exception as e:
        return {'status': 'error', 'detail': str(e)}, 503

For SQLite (single-instance deployments), use a file system heartbeat that checks the database file is readable:

#!/bin/bash
SQLITE_PATH="/app/cat_storage/db.sqlite"
if sqlite3 "$SQLITE_PATH" "SELECT COUNT(*) FROM conversations;" > /dev/null 2>&1; then
    curl -s https://vigilmon.online/heartbeat/db123
fi

Step 6: Monitor the Admin Panel

The Cheshire Cat admin panel at GET /admin is how operators manage plugins, settings, and memory. If the admin UI is down while the API is still running, you lose management access to a live system.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter http://your-server:1865/admin.
  3. Set Expected HTTP status to 200.
  4. Enable Keyword check and look for Cheshire Cat in the response body.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Step 7: Monitor the Memory Ingestion API

The /rabbithole endpoint is how documents, web pages, and files are uploaded to the Cat's memory for RAG. If this endpoint fails, new knowledge can't be ingested into the vector store — silently degrading response quality over time.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter http://your-server:1865/rabbithole/allowed-mimetypes.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 5 minutes.
  5. Click Save.

The /rabbithole/allowed-mimetypes endpoint is a lightweight GET that confirms the ingestion service is initialized without requiring a file upload. A 200 response means the rabbithole is ready to accept documents.

For a more thorough check that actually tests ingestion, schedule a periodic test document upload:

import requests

def check_rabbithole():
    try:
        # Upload a minimal text file to test ingestion health
        resp = requests.post(
            'http://your-server:1865/rabbithole/',
            headers={'Authorization': 'Bearer YOUR_API_KEY'},
            json={'text': 'Vigilmon health check ping.'},
            timeout=10
        )
        if resp.status_code in (200, 202):
            requests.get('https://vigilmon.online/heartbeat/rabbithole123', timeout=5)
    except Exception:
        pass

Step 8: SSL Certificate Expiry Alerts

If you serve Cheshire Cat behind a reverse proxy (nginx, Caddy, Traefik) with HTTPS, certificate renewal failures are silent until users see browser security warnings.

  1. Open the HTTP monitor for your HTTPS Cat URL.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

If you use Let's Encrypt with Caddy or Traefik for automatic renewal, also add a renewal health heartbeat:

# Add to your renewal hook script
curl -s https://vigilmon.online/heartbeat/ssl123

For multiple domains (e.g., cat.yourdomain.com and admin.yourdomain.com), add a separate SSL monitor for each.


Step 9: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a webhook for your team.
  2. Set Consecutive failures before alert to 2 on the FastAPI and WebSocket monitors — brief container restarts can cause single-probe failures.
  3. Set Consecutive failures to 1 on the LLM provider monitor — a down LLM backend immediately breaks all chat responses.
  4. Use Maintenance windows during Cheshire Cat upgrades:
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "abc123", "duration_minutes": 15}'

docker compose pull && docker compose up -d

Summary

| Monitor | Target | What It Catches | |---|---|---| | FastAPI server | HTTP :1865/ | Server crash, container down | | WebSocket chat | Cron WebSocket check | WS handshake failure, chat broken | | LLM provider | OpenAI / Anthropic / Ollama API | Backend unreachable, API outage | | Vector memory (Qdrant) | HTTP :6333/health | Vector DB down, memory retrieval broken | | Vector memory (Chroma) | HTTP :8000/api/v1/heartbeat | Chroma crash, collection unavailable | | Database (PostgreSQL) | TCP :5432 | DB connection loss | | Admin panel | GET /admin | UI crash, management access lost | | Memory ingestion | GET /rabbithole/allowed-mimetypes | Ingestion service down | | SSL certificate | HTTPS domain | TLS renewal failure |

Cheshire Cat AI's power comes from its layered architecture — but each layer is a potential failure point. With Vigilmon watching the FastAPI core, WebSocket endpoint, vector memory, LLM provider, and ingestion API, you'll know about failures before they reach your users and before your Cat's memory goes quietly dark.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →