crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
21.72k stars 3.01k forks source link

[FEATURE] Stop the crew ai execution thread #1343

Closed Sarangk90 closed 1 month ago

Sarangk90 commented 2 months ago

Feature Area

Core functionality

Is your feature request related to a an existing bug? Please link it here.

The issue is linked to following 2 cards:

727

374

Describe the solution you'd like

@joaomdmoura

We are planning to put crewai in production. Crew ai is a backend for conversational UI. Here we have a stop button and we expect to terminate the backend ongoing Crewai execution once the user hits Stop button. Currently there is no way for us to do it successfully without using multiprocessing (which we dont want to do)

I see that you have mentioned about the scope for improvement in our current multi threading approach in this ticket.

Could you please help us fix this ? Do you think this will take longer ?

Why its important:

For our production usecase, if someone keeps on asking question and hitting stop button, the SSE will terminate, but the backend execution of the older request continues. If user does it very frequently, it will effectively take the backend down for other users.

Describe alternatives you've considered

We found a way to do this via Multiprocessing. However, that would mean that individual process will have multiple threads running inside the same process. With Crewai, there will be many threads spun up which might be inefficient as only one cpu core will be assigned per process leading to many threads waiting for execution.

Additional context

No response

Willingness to Contribute

I could provide more detailed specifications

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.