How to Combine CrewAI Agents with Universal Chat History and Multi-LLM Support?
Hello CrewAI Community,
I’m developing a new internal chat application for my team, and I’m aiming for maximum flexibility and autonomy. I’m impressed by the collaborative power of CrewAI, but I’m facing a challenge in fitting it into a full, persistent chat solution.
I originally looked at frameworks like OpenAI’s ChatKit for Python because it handles the chat session history, user management, and multi-turn conversations well. However, it’s very limiting—it forces me to use only OpenAI’s LLMs and their proprietary storage solutions.
My Goal: OmniChatKit (A Universal Chat Solution)
I want to build a solution (let’s call it OmniChatKit for now) that achieves three things:
-
Universal LLM Support: Use ANY LLM (GPT-4, Claude, local models like Llama, etc.) based on cost or performance needs.
-
Persistent History: Store all chat history (messages, user sessions) in standard databases like Redis or Postgres.
-
Powerful Agent Collaboration: When a user asks a complex question, I want to deploy autonomous, specialized agents using CrewAI to perform the task.
Seeking Advice on Integrating CrewAI
My main pain point is connecting the powerful task-based automation of CrewAI back into the continuous, history-based session of a chat application.
-
Bridging the Gap: How do you recommend integrating a CrewAI execution run into an ongoing chat session? When a Crew finishes a task, what is the best practice to capture that final output and seamlessly save it back into the user’s continuous chat history?
-
LLM Configuration: Since my application needs to configure many different LLM providers (for chat history summarization, quick replies, and for the CrewAI agents themselves), is it best to just use the LLM support built into CrewAI (LiteLLM) for all LLM calls in my application, or should I create a separate, unified layer?
-
Scalability Concerns: For an application supporting many concurrent chat sessions, are there any best practices for running CrewAI (e.g., using a manager agent, specific
Processtype, or cloud deployment strategy) to ensure rapid response times?
Any advice from people who have successfully built a long-running, multi-user chat interface powered by CrewAI would be incredibly helpful!
Thank you,
Hans Tsang