-
Notifications
You must be signed in to change notification settings - Fork 46
A blog post announcing Khook #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| export const metadata = { | ||
| title: "Truly Reactive Cloud Native AI Agents with Kagent and Khook", | ||
| publishDate: "2025-09-09T16:00:00Z", | ||
| description: "Khook makes Kagent Agents Reactive", | ||
| author: "Ant Weiss", | ||
| authorIds: ["antweiss"], | ||
| } | ||
|
|
||
|
|
||
| # Agent Cloud-Native in the House! | ||
|
|
||
| Excited by the vision of smart AI agents watching over your Kubernetes cluster? | ||
| Want an easy fully cloud-native way to run your agentic software? | ||
| Time to discover [Kagent](https://kagent.dev)! | ||
| It’s a fairly young OSS project started by the folks at [Solo.io](https://Solo.io) which aims at making the building and running of AI Agents on Kubernetes easy and fun. With all the bells and whistles one would expect - authz and authn, security, visualization, governance and audit, optimization, you name it. Some of it on the roadmap, some of it being built as we speak. | ||
|
|
||
|  | ||
| # Joining the Community | ||
| I started playing with Kagent a couple of months ago, loved its ergonomics and decided to build a workshop around it - meanwhile fixing some docs, submitting PRs and joining the community meetings. If you’re looking for a great OSS community to join - look no further - it’s a warm and welcoming bunch of very smart folks. And there’s a lot of work to be done! | ||
|
|
||
| # The Need for Reactivity | ||
| So after working with Kagent for a while I realized something was missing. For me, anyway. You see - conceptually the difference between an agent and a tool is that an agent acts on your behalf, taking decisions in alignment with the declared goals and guidelines. (While with a tool - you need to take all of the decisions yourself and command your wishes.) In this respect - much of the cloud native software is already agentic. Anything built on KRM ( | ||
| [Kubernetes Resource Model](https://www.geeksforgeeks.org/linux-unix/kubernetes-resource-model-krm-and-how-to-make-use-of-yaml/)) is declarative by nature - the user declares the desired state and then the operators or the controllers make sure it becomes the actual state. And in that respect - they are definitely our agents - acting on our behalf, recreating missing pods, reconciling broken states. True agents are reactive by nature - they listen on events and correct course accordingly with state or goal declarations being just one type of event. | ||
|
|
||
| And that’s exactly what Kagent didn’t have. Until now in order to summon an agent - one needed to chat to it - either in Kagent’s sleek Web UI, over CLI or API. But what good is an agent if it just sits there waiting for instructions? I wanted a way to make my agents reactive. | ||
|
|
||
| # Introducing Khook | ||
|
|
||
|  | ||
|
|
||
| Enter Khook - a Kubernetes controller that allows defining: | ||
| - Kubernetes events to listen to | ||
| - the agent to call | ||
| - the templated prompt to pass to the agent | ||
|
|
||
| Khook assumes autonomous remediation and incident response. Finally - the ops person's dream come true! | ||
|
|
||
| The following diagram shows how Khook works: | ||
|
|
||
|  | ||
|
|
||
| It’s been a while since I’ve developed a full-blown Kubernetes controller from scratch and I have to thank Kiro and Cursor (and specifically Sonnet 3.7) for taking care of all the boilerplate for me. This definitely made me more productive. | ||
|
|
||
| # A Hook to the Future | ||
| Last Monday I presented Khook to the Kagent community and it makes me happy that it was met with a lot of excitement. In fact - since Friday - the [khook repository](https://github.com/kagent-dev/khook) (with the gracious help from Eitan Yarmush) has been transferred in the kagent-dev org on Github and we’re actively looking for early users and contributors to take the hooks for test drives and find interesting bugs. Oh, and if you clicked on the link - make sure to star the repo. It will make my day brighter 🙏 | ||
|
|
||
| Here's a demo of Khook triggering a Kagent agent: <YouTube id="cYXLKAXZnso" /> | ||
|
|
||
| While building this project I realized it can be of much wider use - becoming the connecting tissue between virtually any type of event (think task queues, DB transactions, webhooks) and any type of A2A-compatible agent (all agent communication in Kagent is based on the [A2A protocol](https://github.com/a2aproject/A2A)). Especially now with [Kagent supporting BYO agents](https://kagent.dev/docs/kagent/examples/a2a-byo). So yes - a lot of space for improvement, innovation, experimentation. | ||
|
|
||
| Find this exciting too? Drop me a line, [join the Kagent community](https://discord.com/invite/Fu3k65f2k3) and contribute to Kagent or Khook or both. | ||
|
|
||
| And may our future be agentic. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.