Comparisons / CrewAI vs Semantic Kernel
CrewAI vs Semantic Kernel: Which Agent Framework to Use?
CrewAI crewai organizes work into agents, tasks, and crews. Semantic Kernel semantic kernel is microsoft's enterprise sdk for building ai agents. Here is how they compare — and what the same patterns look like in plain Python.
By the numbers
CrewAI
48.0k
6.5k
Python
MIT
2023-10-27
João Moura
Semantic Kernel
27.6k
4.5k
C#
MIT
2023-02-27
Microsoft
GitHub stats as of April 2026. Stars indicate community interest, not necessarily quality or fit for your use case.
| Concept | CrewAI | Semantic Kernel | Plain Python |
|---|---|---|---|
| Agent | Agent(role, goal, backstory, tools, llm) | ChatCompletionAgent with Kernel, instructions, and service config | A function with a system prompt and a tools dict |
| Tools | Tool registration with @tool decorator, custom Tool classes | — | A dict: tools[name](**args) |
| Agent Loop | Internal to Agent execution, hidden from user | — | A while loop over messages with tool_calls check |
| Task Delegation | Crew(agents, tasks, process=sequential/hierarchical) | — | A task queue processed in a while loop with a budget cap |
| Memory | ShortTermMemory, LongTermMemory, EntityMemory | SemanticTextMemory with embeddings and vector stores | A dict injected into the system prompt |
| State | Task output passed between agents via Crew orchestration | — | A dict tracking tool calls and results |
| Tools / Plugins | — | KernelPlugin with @kernel_function decorators, typed parameters | A dict of callables: tools = {"search": lambda q: ...} |
| Planning | — | StepwisePlanner, HandlebarsPlanner for multi-step decomposition | A system prompt that says 'break this into steps' — the LLM plans natively |
| Orchestration | — | Kernel.invoke() with plugin resolution and filter pipeline | A while loop: call LLM, check for tool_calls, dispatch, repeat |
| Multi-Language | — | C#, Python, Java SDKs with shared abstractions | The HTTP API is the same in every language — just POST JSON |
What both do in plain Python
Every concept in the table above — agent, tools, loop, memory, state — maps to a handful of Python primitives: a function, a dict, a list, and a while loop. Both CrewAI and Semantic Kernel wrap these primitives in their own class hierarchies and APIs. The underlying pattern is the same ~60 lines of code. The difference is how much ceremony each framework adds on top.
When to use CrewAI
CrewAI shines for multi-agent setups where you want named roles ("researcher", "writer"). But the core mechanics — tool dispatch, the agent loop, task scheduling — are the same patterns you can build in plain Python.
What CrewAI does
CrewAI models multi-agent systems as a crew of specialists. Each Agent has a role ("Senior Researcher"), a goal ("Find the best data sources"), a backstory that shapes its behavior, and a set of tools it can use. Tasks define discrete units of work with expected outputs. The Crew orchestrates execution — sequentially, hierarchically, or with a custom process. CrewAI also provides memory systems (short-term, long-term, entity) and delegation, where one agent can hand off subtasks to another. The mental model is a team of people collaborating on a project. For prototyping multi-agent workflows where you want to reason about roles and responsibilities, it provides a clean vocabulary.
The plain Python equivalent
An Agent in CrewAI is a function with a system prompt that includes the role, goal, and backstory. The tools dict maps names to callables. Task delegation is a list of tasks processed in order — each task calls the assigned agent function with the task description appended to the messages. Hierarchical execution is a manager agent that decides which sub-agent to call next (just another tool choice). Memory is a dict injected into the system prompt. The entire crew pattern — multiple agents, task queue, delegation — is a for-loop over tasks, where each iteration calls the right agent function. No Crew class, no process kwarg. Just functions calling functions with a shared state dict passed between them.
When to use Semantic Kernel
Semantic Kernel earns its complexity in enterprise environments with Azure OpenAI, .NET backends, and existing Microsoft infrastructure. But the core agent pattern — LLM call, tool dispatch, loop — is identical to what you can build in 60 lines of Python.
What Semantic Kernel does
Semantic Kernel is Microsoft's SDK for building AI-powered applications. The central object is the Kernel — it holds your AI service connections, plugins, and configuration. Plugins are collections of KernelFunctions (decorated Python/C# methods) that the LLM can call as tools. Planners like StepwisePlanner break complex goals into multi-step plans, choosing which plugins to invoke at each step. The SDK provides deep integration with Azure OpenAI, including managed identity auth, content filtering, and deployment management. It also ships memory connectors for vector stores (Azure AI Search, Qdrant, Pinecone) and supports filters — middleware that runs before and after each function invocation. For teams already on Azure with .NET backends, it fits naturally into the existing stack.
The plain Python equivalent
The Kernel is a config object that holds your API key and a dict of tools. A KernelFunction is a regular function in that dict. The Planner is a system prompt instruction — tell the LLM to break the task into steps and it will, no planner class needed. Memory is a list of strings you embed and search, or just a dict you inject into the prompt. Orchestration is the same while loop every agent uses: call the LLM, check if the response has tool_calls, look up the function in your tools dict, call it, append the result, repeat. The filter pipeline is a try/except around your function calls. The entire agent — including plugin dispatch, planning, and memory — is about 60 lines. No Kernel object, no plugin registry, no planner hierarchy.
Or build your own in 60 lines
Both CrewAI and Semantic Kernel implement the same 8 patterns. An agent is a function. Tools are a dict. The loop is a while loop. The whole thing composes in ~60 lines of Python.
No framework. No dependencies. No opinions. Just the code.
Build it from scratch →