Currently, the NullDriftCrewStorage class in nulldrift_agents.py opens a completely new with httpx.Client() as client: context block for every single save() and search() call. Optimize this by instantiating a persistent self.client = httpx.Client() in the __init__ method to reuse the TCP connection (HTTP Keep-Alive), which will significantly reduce network latency during high-frequency agent actions.
Currently, the
NullDriftCrewStorageclass innulldrift_agents.pyopens a completely newwith httpx.Client() as client:context block for every singlesave()andsearch()call. Optimize this by instantiating a persistentself.client = httpx.Client()in the__init__method to reuse the TCP connection (HTTP Keep-Alive), which will significantly reduce network latency during high-frequency agent actions.