{"id":28714764,"url":"https://github.com/crewaiinc/template_conversational_example","last_synced_at":"2025-07-05T03:39:25.413Z","repository":{"id":293752310,"uuid":"985009637","full_name":"crewAIInc/template_conversational_example","owner":"crewAIInc","description":"Demo example of a crew with a conversational interface","archived":false,"fork":false,"pushed_at":"2025-05-16T23:36:26.000Z","size":42142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-15T01:41:56.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://demo-conversational-crew.streamlit.app/","language":"MDX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crewAIInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T22:38:52.000Z","updated_at":"2025-05-19T00:56:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"089d0009-473e-4879-b56e-4cdef898d3f0","html_url":"https://github.com/crewAIInc/template_conversational_example","commit_stats":null,"previous_names":["crewaiinc/template-conversational-example","crewaiinc/template_conversational_example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crewAIInc/template_conversational_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Ftemplate_conversational_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Ftemplate_conversational_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Ftemplate_conversational_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Ftemplate_conversational_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crewAIInc","download_url":"https://codeload.github.com/crewAIInc/template_conversational_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Ftemplate_conversational_example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263677008,"owners_count":23494615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-15T01:40:37.836Z","updated_at":"2025-07-05T03:39:25.406Z","avatar_url":"https://github.com/crewAIInc.png","language":"MDX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrewAI Enterprise Chatbot\n\nThis project demonstrates a CrewAI flow for building chatbots with CrewAI Enterprise. It integrates a single crew/agent to handle conversational routing and a Streamlit-based chatbot interface for demonstration purposes.\n\n## Project Overview\n\nThe project includes:\n\n- A CrewAI flow with a configured crew/agent for handling chat messages.\n- A Streamlit app (`demo/streamlit_app.py`) that provides an interactive chatbot interface.\n- Backend API endpoints that showcase CrewAI Enterprise functionalities.\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone \u003crepo-url\u003e\n   cd demo-conversational-crew\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   crewai install\n   ```\n\n   or\n\n   ```bash\n   uv sync\n   ```\n\n3. Configure all required environment variables in `.env` file.\n\n## Usage\n\n### Running the Terminal Chat\n\nA script named `terminal_chat.py` is provided to run a terminal-based chat session. To run it, execute:\n\n```bash\n.venv/bin/python terminal_chat.py\n```\n\nThis script demonstrates how to interact with the CrewAI flow through the terminal.\n\n### Running the Streamlit Chatbot\n\n**Your crew needs to be deployed to CrewAI Enterprise for this demo to work.**\n\nTo launch the interactive chatbot demo using Streamlit, run:\n\nFor secure handling of your crew URLs and API keys, this project uses `secrets.toml`. \nFollow these steps to set up your environment:\n\n1. Create a `secrets.toml` file in the `.streamlit` directory:\n\n   ```bash\n   mkdir -p demo/.streamlit \u0026\u0026 touch demo/.streamlit/secrets.toml\n   ```\n\n2. Add your environment variables to `secrets.toml`:\n\n   ```toml\n   # demo/.streamlit/secrets.toml\n   base_url = \"https://YOUR-CREWAI-DEPLOYMENT-URL.crewai.com\"\n   bearer_token = \"YOUR-BEARER-TOKEN-HERE\"\n   # Add any other necessary environment variables\n   ```\n\n3. Ensure `secrets.toml` is listed in your `.gitignore` file to prevent accidental commits of sensitive information.\n\nWhen deploying to production, use the appropriate method for your hosting platform to set these environment variables securely.\n\n```bash\nstreamlit run demo/streamlit_app.py\n```\n\n### Run some automated tests\n\nYou can run some automated tests with two consecutive messages by executing:\n\n```bash\n.venv/bin/python test_chat.py\n```\n\n## API Calls\n\nThe project utilizes CrewAI Enterprise API calls to manage chat sessions and process messages. Key API interactions include:\n\n- **Initiating a Chat Session:** A POST request is sent to the designated endpoint with a JSON payload specifying the chat context, starting the conversation.\n\n- **Processing Chat Messages:** User inputs are routed through the configured crew/agent. API calls handle routing, processing, and returning responses in a structured format.\n\nFor detailed implementation, review the configuration files in `src/conversational_routing/crews/assistant_crew/config/` and the Crew files.\n\nThe API is a standard CrewAI Enterprise API, so refer to the [CrewAI Enterprise API documentation](https://help.crewai.com/using-your-crews-api-in-crewai) for more information.\n\nThe first message sends the following JSON payload to the `/kickoff` endpoint:\n\n```json\n{\n    \"current_message\": \"Hello, I am a chatbot. How can I help you today?\"\n}\n```\n\nIn response, the API will respond with a `kickoff_id`:\n\n```json\n{\n    \"id\": \"UNIQUE-KICKOFF-ID\"\n}\n```\n\nIn order to get the chatbot response, keep polling the `/status/{kickoff_id}` endpoint. The response will include the `response` and `id` fields.\n\n```json\n{\n    \"state\": \"SUCCESS\",\n    \"result\": \"{ \\\"response\\\": \\\"Assistant response here.\\\", \\\"id\\\": \\\"UNIQUE-CONVERSATION-ID\\\" }\"\n}\n```\n\nThe Crew is using [@persist](https://docs.crewai.com/concepts/flows#flow-persistence) to store the conversation history and uses `UNIQUE-CONVERSATION-ID` as a key.\n\nConsecutive messages should be sent to the `/kickoff` endpoint with the following payload:\n\n```json\n{\n    \"current_message\": \"I need help with something.\",\n    \"id\": \"UNIQUE-CONVERSATION-ID\"\n}\n```\n\n## Additional Information\n\n- Verify that any required environment variables are set.\n- Check the source code for additional comments and developer notes regarding API endpoints and operation.\n- Contributions and issues are welcome. Feel free to open a pull request or issue on the repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewaiinc%2Ftemplate_conversational_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrewaiinc%2Ftemplate_conversational_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewaiinc%2Ftemplate_conversational_example/lists"}