Skip to content

Conversation

@rishabh998186
Copy link
Contributor

@rishabh998186 rishabh998186 commented Oct 27, 2025

Hey! This PR adds support for CrewAI and LangGraph frameworks to the kagent init command. Now developers can choose which framework they want to use when creating new agent projects, instead of being locked into just ADK.

I've added two new framework options that work alongside the existing ADK support. Users can now run:


kagent init my-agent --framework crewai
kagent init my-agent --framework langgraph

Each framework gets its own complete project setup with all the necessary files - Python code, Dockerfiles, configs, and a helpful README with usage examples. The templates are framework-specific, so CrewAI projects get crew.py files and LangGraph projects get graph.py files.

I also simplified the CLI while I was at it. Instead of requiring three arguments, it now just needs the agent name plus optional flags. The --framework flag defaults to "adk" so existing workflows won't break.

The implementation uses a registry pattern under the hood, which should make it easier to add more frameworks down the line if needed.

Closes #1049

rishabh998186 added 3 commits October 28, 2025 03:04
@rishabh998186 rishabh998186 force-pushed the feature/init-crewai-langgraph-templates branch from d599545 to 35d9a17 Compare October 27, 2025 21:35
Copy link
Collaborator

@peterj peterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lose a lot of confidence in PRs when I try to build the binary, and the basic build fails. Did you test all commands and made sure it all works as it should?

❯  go build cli/cmd/kagent/main.go 
# github.com/kagent-dev/kagent/go/cli/internal/agent/frameworks/common
cli/internal/agent/frameworks/common/base_generator.go:4:2: "io/fs" imported and not used
cli/internal/agent/frameworks/common/base_generator.go:50:2: declared and not used: tmpl
cli/internal/agent/frameworks/common/base_generator.go:50:15: undefined: template
cli/internal/agent/frameworks/common/base_generator.go:56:14: undefined: fmt
cli/internal/agent/frameworks/common/base_generator.go:58:1: missing return

@rishabh998186
Copy link
Contributor Author

@peterj
Let me address your suggestions and get the GitHub checks passing, then I test everything thoroughly (init, build, deploy, and run for all three frameworks) and then i report back you with the results.

@rishabh998186 rishabh998186 force-pushed the feature/init-crewai-langgraph-templates branch from 07bf827 to fcce92e Compare October 28, 2025 12:24
Copy link
Collaborator

@peterj peterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another thing I noticed -- there's missing docker compose files in the template folder which means kagent run won't work.

@rishabh998186
Copy link
Contributor Author

I Created Docker-compose.yaml.tmpl for both LangGraph and crewAI copied from ADK framework template

@rishabh998186 rishabh998186 requested a review from peterj October 30, 2025 07:10
@rishabh998186 rishabh998186 force-pushed the feature/init-crewai-langgraph-templates branch from b6918d6 to a4c5ad1 Compare October 30, 2025 07:27
@rishabh998186 rishabh998186 force-pushed the feature/init-crewai-langgraph-templates branch from ef08c4b to be81c1c Compare October 30, 2025 13:39
@rishabh998186
Copy link
Contributor Author

@peterj, when you get a chance, could you review my PR and let me know if there are any changes needed

@rishabh998186
Copy link
Contributor Author

hey @peterj
All CI/CD checks are passing now PR is ready for review.

key := fmt.Sprintf("%s:%s", userID, threadID)
state := c.crewaiFlowStates[key]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are from running go fmt to ensure the code follows Go's standard formatting conventions (indentation, spacing, code consistency). These changes are purely cosmetic and don't affect the framework implementation at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add CrewAI and LangGraph as templates for kagent init

2 participants