P

Cheshire Cat AI

Created Feb 8, 2023 by cheshire-cat-ai

Categories

Language:

Python

Stars:

3K

Forks:

385

README

Cheshire Cat AI 🇮🇹 Stregatto - 🇨🇳 柴郡貓 - 🇮🇳 चेशायर बिल्ली - 🇷🇺 Чеширский кот

AI agent as a microservice

The Cheshire Cat is a framework to build custom AI agents:

  • ⚡️ API first, to easily add a conversational layer to your app
  • 💬 Chat via WebSocket and manage your agent with an customizable REST API
  • 🐘 Built-in RAG with Qdrant
  • 🚀 Extensible via plugins
  • 🪛 Event callbacks, function calling (tools), conversational forms
  • 🏛 Easy to use admin panel
  • 🌍 Supports any language model via langchain
  • 👥 Multiuser with granular permissions, compatible with any identity provider
  • 🐋 100% dockerized
  • 🦄 Active Discord community and easy to understand docs

Quickstart

To make Cheshire Cat run on your machine, you just need docker installed:

docker run --rm -it -p 1865:80 ghcr.io/cheshire-cat-ai/core:latest

Enjoy the Cat!
Follow instructions on how to run it properly with docker compose and volumes.

Minimal plugin example

    Hooks (events)
from cat.mad_hatter.decorators import hook

# hooks are an event system to get finegraned control over your assistant
@hook
def agent_prompt_prefix(prefix, cat):
    prefix = """You are Marvin the socks seller, a poetic vendor of socks.
You are an expert in socks, and you reply with exactly one rhyme.
"""
    return prefix
    Tools
from cat.mad_hatter.decorators import tool

# langchain inspired tools (function calling)
@tool(return_direct=True)
def socks_prices(color, cat):
    """How much do socks cost? Input is the sock color."""
    prices = {
        "black": 5,
        "white": 10,
        "pink": 50,
    }

    price = prices.get(color, 0)
    return f"{price} bucks, meeeow!" 
    Conversational Forms

Conversational form example

from pydantic import BaseModel
from cat.experimental.form import form, CatForm

# data structure to fill up
class PizzaOrder(BaseModel):
    pizza_type: str
    phone: int

# forms let you control goal oriented conversations
@form
class PizzaForm(CatForm):
    description = "Pizza Order"
    model_class = PizzaOrder
    start_examples = [
        "order a pizza!",
        "I want pizza"
    ]
    stop_examples = [
        "stop pizza order",
        "not hungry anymore",
    ]
    ask_confirm = True

    def submit(self, form_data):

        # do the actual order here!

        # return to convo
        return {
            "output": f"Pizza order on its way: {form_data}"
        }

Docs and Resources

Roadmap & Contributing

Attention: while version 2 is being worked out, we'll only accept bug fixes for v1. Send your PR for v1 on branch develop. Do not expect to see merged PRs not previously discussed and agreed upon in an issue.

Detailed roadmap is here.
Send your pull request to the develop branch. Here is a full guide to contributing.

We are committed to openness, privacy and creativity, we want to bring AI to the long tail. If you want to know more about our vision and values, read the Code of Ethics.

Join our community on Discord and give the project a star ⭐! Thanks again!🙏

License and trademark

Code is licensed under GPL3.
The Cheshire Cat AI logo and name are property of Piero Savastano (founder and maintainer).

Which way to go?

(back to top)

"Would you tell me, please, which way I ought to go from here?"
"That depends a good deal on where you want to get to," said the Cat.
"I don't much care where--" said Alice.
"Then it doesn't matter which way you go," said the Cat.

(Alice's Adventures in Wonderland - Lewis Carroll)
Last updated: Jan 21, 2026

More MCP servers built with Python

Stable Diffusion WebUI

Stable Diffusion web UI

By AUTOMATIC1111 160.1K
Transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

By huggingface 155.5K
PyTorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

By pytorch 96.8K