-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Thread in pending state while storing memory in the background #3851
Comments
What's happening is it's scheduling the ingestion for the future but o nthe same thread; so long as the scheduled run hasn't completed, the thread is still considered "pending" |
@hinthornw in that case after 3 seconds I should see the memory created right? Also If i click on Join run then its creating a new fork. |
Its been there for so long and If I proceed with another question/new turn then the a new fork is getting created for the my question. I dont know whats happening. Could you please help me out with this. I provided the complete code. |
is there an error in the langsmith trace |
There is no error in the langsmith trace as well |
You could try running my example please. |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
-------------------------Application logic Agent/Graph------------------------------
def call_model(state: BookingAppointmentState, store: BaseStore, config: RunnableConfig) -> Command[Literal['tool_node', 'schedule_memories']]:
model = ChatOpenAI(model="gpt-4o", openai_api_key=os.getenv("OPEN_AI_API_KEY")).bind_tools(tools)
def tool_node(state: BookingAppointmentState, store: BaseStore, config: RunnableConfig) -> Command[Literal['ask_human', 'call_model']]:
tool_names = {tool.name: tool for tool in tools}
tool_calls = state['messages'][-1].tool_calls
results = []
def ask_human(state: BookingAppointmentState, store: BaseStore, config: RunnableConfig) -> Command[Literal['call_model']]:
user_response = interrupt(state['question_to_patient'])
def schedule_memories(state: MessagesState, config: RunnableConfig) -> None:
memory_client = get_client()
-------------------------------------- Memory Agent / Graph ---------------------------------------------
def scatter_schemas(state: MessagesState, config: RunnableConfig) -> list[Send]:
memory_types = config['configurable']['memory_types']
sends = []
def update_appointments(state: MessagesState, store: BaseStore, config: RunnableConfig):
user_id = config['configurable']['user_id']
def update_conversations(state: MessagesState, store: BaseStore, config: RunnableConfig):
user_id = config['configurable']['user_id']
builder = StateGraph(MessagesState)
builder.add_node('scatter_schemas', scatter_schemas)
builder.add_node('update_appointments', update_appointments)
builder.add_node('update_conversations', update_conversations)
builder.add_conditional_edges( START, scatter_schemas, ["update_appointments", "update_conversations"] )
System Info
using the latest versions
The text was updated successfully, but these errors were encountered: