KitchenAI Logo

KitchenAI

← Back to blog

Published on February 19, 2025 by Saugat Sthapit

🔥 Why is the KitchenAI Handler Powerful?

KitchenAI handlers are powerful because they allow AI workflows to be modular, reusable, and API-accessible, turning AI models into scalable services. Unlike traditional AI implementations, handlers standardize interactions, making it easier to manage multiple AI agents, tools, and workflows under one control plane.


🔹 1️⃣ Handlers Abstract AI Complexity

Without handlers:

With handlers:

🔹 Example:

@kitchen.query.handler("web-search")
async def web_search_handler(data: WhiskQuerySchema) -> WhiskQueryBaseResponseSchema:
    agent = ReActAgent(tools=web_search_toolhouse.get_tools(bundle="exa_web_search"), llm=llm)
    response = await agent.achat(data.query)
    return WhiskQueryBaseResponseSchema.from_llm_invoke(data.query, response.response)

✅ Now, any application can call web-search instead of directly integrating an AI model.


🔹 2️⃣ Handlers Make AI Workflows API-First

KitchenAI turns any AI process into a callable API, allowing AI services to be accessed from web apps, mobile apps, automation pipelines, or external systems.

Without handlers:

With handlers:

🔹 Example:

whisk query web-search "Latest trends in AI startups"

No need for direct Python calls – KitchenAI exposes AI capabilities as an API.


🔹 3️⃣ Handlers Enable Multi-Agent Orchestration

Without handlers:

With handlers:

🔹 Example:

@kitchen.query.handler("ai-sales-prospecting")
async def ai_sales_prospecting_handler(data: WhiskQuerySchema) -> WhiskQueryBaseResponseSchema:
    workflow = SalesProspectingWorkflow(timeout=None)
    result = await workflow.run(text=data.query)
    return WhiskQueryBaseResponseSchema.from_llm_invoke(data.query, f"Generated Email:\n{result.email}")

Sales AI can now access web search, competitor research, and prospect discovery in one handler.


🔹 4️⃣ Handlers Improve Observability & Control

Without handlers:

With handlers:

🔹 Example: whisk list shows all registered handlers:

whisk list

Easier to manage AI services at scale.


🔹 5️⃣ Handlers Simplify AI Deployment

Without handlers:

With handlers:

🔹 Example:

whisk run ai-sales-prospecting:kitchen --reload

AI is now a production-ready service.


🚀 Final Takeaway: Why Handlers Make KitchenAI Powerful

Standardization – All AI capabilities become API-first, making AI easy to integrate.
Scalability – AI models, RAG tools, and workflows become modular, reusable components.
Observability – AI queries & responses are logged, making debugging easier.
Flexibility – Multiple LLMs, agents, and workflows can be combined dynamically.
Production-Ready – Handlers make AI deployable via KitchenAI’s control plane.

🔹 KitchenAI Handlers Turn AI Into a Scalable API Service! 🚀

💡 Now, AI isn’t just a model—it’s an orchestrated system!

Written by Saugat Sthapit

← Back to blog