# Training for langgraph agent

**URL:** <https://discuss.huggingface.co/t/training-for-langgraph-agent/96836>\
**Category:** Intermediate\
**Created:** [July 11, 2024, 2:54pm UTC](https://discuss.huggingface.co/t/training-for-langgraph-agent/96836 "2024-07-11T14:54:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chgrdj](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@chgrdj](https://discuss.huggingface.co/u/chgrdj)\
**Post date:** [July 11, 2024, 2:54pm UTC](https://discuss.huggingface.co/t/training-for-langgraph-agent/96836/1 "2024-07-11T14:54:36Z")

</div>

Hello everyone,

I wanna use a LLM to create an agent in langgraph with this kind of architecture:

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/9/b/9bb89d785b145d710befeceba774ef571f0cb642.png)

The idea is similar to a React agent where the model has to provide a prompt for my terminal tool and observe if it achieve a given objective.  
I have a question : how should i train such model?  
Could i use DPO/ORPO procedure to align my model with multi-step context ?  
Or is there a smarter way to do that?  
Thanks
