Importing Agent from ADK in a notebook takes 29 seconds?
Not sure what the reason is but I have a notebook demonstrating ADK, where the import of Agent from ADK just took 29s seconds
All the other imports and operations were instant?
Thanks for reporting. We are looking into it.
cc: @Jacksunwei
I can reproduce. It took me about 10~20 seconds.
Thank you for filing this issue. We are doing some housekeeping, and since there has been no recent activity on this thread, we will be closing it as stale.
If this is still an issue for you with the latest version of the library, please feel free to comment, and we will be happy to reopen it.
Thanks again for your contribution!
as of versions 1.14.1 , (Tried couple of previous versions too), the import time is atrocious, experiencing anywhere between 15 to 30 seconds of import time. Tried it in notebook, and integration in a Django Project.
Hi @jexp Thanks for reporting! There have been several performance updates in recent releases.Please try importing the Agent using the latest available version and check if the import time has improved.
@klateefa , here is a crude test I did between 1.14.1 and 1.16
TLDR: No change, similar results to OP
import time
t1 = time.time()
from google.adk import agents
print("Import took", time.time() - t1, "seconds")
Results were within margin of error in each case
Running with just python - 4.5-5s Running with Debugger - 14-16s
I ran this in a venv environment, running in conda and notebook environments usually takes upto 2x longer for me, Can do more AB testing later if you want
Thanks for reporting this issue - this was actually the earliest report of the ADK import performance problem (April 2025)!
This issue is a duplicate of #2433, which has identified the root cause: eager imports in ADK's __init__.py files causing 8-20+ second import overhead. While #157 was reported first, #2433 has accumulated more comprehensive root cause analysis and community discussion, so we're consolidating tracking there.
Key timeline:
- April 13, 2025: This issue (#157) first reported 29s import time
- August 8, 2025: #2433 identified root cause (eager
__init__.pyimports) - October 14, 2025: @JokingLemon confirmed still present in v1.16 (4.5-5s in venv, 14-16s with debugger)
As @JokingLemon's recent testing shows, this hasn't been resolved yet despite the team's efforts. Please follow #2433 for updates on the fix. The team has created a Colab notebook to track optimization targets.
Duplicate of #2433
Closing as duplicate of #2433