Skip to content

Conversation

@tcdent
Copy link
Collaborator

@tcdent tcdent commented Jan 14, 2025

  • Graphs are constructed linearly, where agents get access to tools and all tasks are added as edges to an agent. Possible we create additional templating to define more practical graph structures. This could help solve the problem of agent/task insertion; where in the chain do new entries reside? CLI syntax could be added to indicate where in the chain new agents & tasks should be inserted. Added a --position flag to the cli to add an agent or task either at the begin or end of the graph node chain. Possible we can use numeric indexing or an interactive interface to add more flexibility in the future.

  • LangGraph tools are based on tool_packages branch, but still needs merge. Tools need to be added to both the Agent definition, and to the ToolNode.

  • LangGraph models providers each have their own class (ChatAnthropic, ChatOpenAI, etc) so this needs to be expanded to support more and/or provide friendly messaging when a user needs to manually intervene. A full list of options is available: https://python.langchain.com/docs/integrations/providers/

  • agentstack init now accepts a --framework flag that overrides the framework the template has been exported from. In theory it should be possible to have full compatibility between frameworks, depending on how we handle graph construction. Look into CrewAI flows for a potential way to implement true graphs. (CrewAI also has a hierarchical mode, but it relies on a central Manager node to delegate, instead of defining a rich hierarchy.)

  • A lot of the cookiecutter template data is duplicated between frameworks since we're using variables extensively; possible we can refactor the template structure and share more common files between frameworks.

  • A lot of logic is duplicated between cookiecutter templates and AST code generation; possible we minimize the use of cookiecutter templates and instead construct projects using AST methods when building from templates. This ended up becoming necessary since LangGraph LLMs need to install dependencies and import separate classes for each provider; the project's venv needed to be created in order to handle installation at the same time, so now all agents, tasks & tools are added to the user project with AST instead of templating.

  • I broke the wizard. :/

tcdent added 4 commits January 7, 2025 09:58
- allow initializing LangGraph projects from templates.
- support creation of Agents and Tasks in LangGraph projects.
- TODO merge tool_packages branch for tools support.
… the project exists. This allows us to install dependencies for tasks and agents as well as tools.

Broke the wizard. TODO: fix that.
Handle tool nodes as a specific graph type.
Migrate TemplateConfig to use 'llm' instead of 'model'.
@bboynton97 bboynton97 marked this pull request as ready for review January 24, 2025 22:56
@bboynton97 bboynton97 changed the title WIP LangGraph support LangGraph support Jan 24, 2025
Copy link
Contributor

@bboynton97 bboynton97 left a comment

Choose a reason for hiding this comment

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

tl;dr
lgtm

@tcdent tcdent merged commit 754b3c5 into agentstack-ai:main Jan 24, 2025
9 checks passed
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.

2 participants