-
Notifications
You must be signed in to change notification settings - Fork 218
agent short & long term memory with langgraph. #851
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
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
|
|
A few thoughts from my side:
|
|
hi, minmin @minmin-intel As our discussion with chendi, I would like to integrate langgraph memory implementations. langgraph implements the short-term & long-term memory: see this reference: https://langchain-ai.github.io/langgraph/concepts/persistence/
And,
for the
I will integrate the |
test short-term memory
|
|
add timeout handling for LLM response, which can return we can also add node-retry, like this: https://github.com/langchain-ai/langgraph/blob/main/docs/docs/how-tos/node-retries.ipynb https://github.com/langchain-ai/langgraph/blob/main/docs/docs/how-tos/tool-calling-errors.ipynb |
for more information, see https://pre-commit.ci
|
need discuss the |
|
if not set |
This is interesting, is this only happened on specific CI node? or to certain docker runtime version? |
| parser.add_argument("--custom_prompt", type=str, default=None) | ||
| parser.add_argument("--with_memory", type=bool, default=False) | ||
| parser.add_argument("--with_store", type=bool, default=False) | ||
| parser.add_argument("--timeout", type=int, default=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for v1.1 timeout only applies to waiting for LLM response. Can we add timeout for tools in later release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will comfirm
|
|
||
|
|
||
| class PersistenceInfo(BaseModel): | ||
| user_id: str = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the relationship between user_id and assistant_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will comfirm
|
|
||
| logger.info("========initiating agent============") | ||
| logger.info(f"args: {args}") | ||
| agent_inst = instantiate_agent(args, args.strategy, with_memory=args.with_memory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instantiate_agent when microservice starts makes sense when it is chat_completion, but does not quite make sense when it is assistants api. Shall we initiate agent only when user send a create_assistant request? And even then, we are not materializing the agent, but instead only record the configs (like llama-stack create_agent), the agent is then materialized later when user send request to the thread api (like llama-stack get_agent).
The benefits of such an approach: one microservice can support multiple configs, which means multiple different types of agents, instead of just one config. So this is more scalable.
* draft a demo code for memory. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add agent short-term memory with langgraph checkpoint. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add save long-term memory func. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add save long-term memory func. * add timeout for llm response. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix ut with adding -e HABANA_VISIBLE_DEVICES=all. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
integrate llama stack implementations of the agent memory, refer https://github.com/meta-llama/llama-stack/blob/main/llama_stack/providers/impls/meta_reference/agents/agents.py#L27