SciPhi-AI / R2R

The most advanced Retrieval-Augmented Generation (RAG) system, containerized and RESTful
https://r2r-docs.sciphi.ai/
MIT License
3.64k stars 270 forks source link

make agent async safe #1251

Closed emrgnt-cmplxty closed 1 month ago

emrgnt-cmplxty commented 1 month ago

[!IMPORTANT] Made the agent system asynchronous safe by introducing locks and modifying conversation handling to be asynchronous, with minor logging and state management changes.

  • Agent System:
    • Introduced asyncio.Lock in Conversation class in agent.py to ensure thread safety.
    • Modified add_message and get_messages in Conversation to be asynchronous.
    • Updated arun and process_llm_response methods in R2RAgent and R2RStreamingAgent to handle asynchronous message operations.
  • Retrieval Service:
    • Added logging for received queries in retrieval_service.py.
  • Search Pipeline:
    • Adjusted state management in search_pipeline.py to use request_state instead of self.state.
  • Web App:
    • Changed agentUrl in index.tsx to use local server URL.

This description was created by Ellipsis for a209fb0169b3147a1a8c23a92254b34c856ebb41. It will automatically update as commits are pushed.