Skip to content

Commit

Permalink
new edit
Browse files Browse the repository at this point in the history
  • Loading branch information
tonykipkemboi committed Oct 20, 2024
1 parent 21df756 commit c4149ed
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 38 deletions.
86 changes: 63 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,94 @@
# CrewaiNotebooklmClone Crew
# 🤖📓🎧 CrewaiNotebooklmClone Crew

Welcome to the CrewaiNotebooklmClone Crew project, powered by [CrewAI](https://crewai.com) and [Cerebras](https://cerebras.ai). This template is designed to help you set up a multi-agent AI system with ease, leveraging the powerful and flexible framework provided by crewAI. Our goal is to enable your agents to collaborate effectively on complex tasks, maximizing their collective intelligence and capabilities.
Welcome to the **CrewaiNotebooklmClone** project, powered by [CrewAI](https://crewai.com), [Cerebras](https://cerebras.ai), and [ElevenLabs](https://www.elevenlabs.io)!

## Installation
This project showcases the capabilities of multi-agent collaboration for podcast production, demonstrating a complete workflow from script creation to audio generation. 

Ensure you have Python >=3.10 <=3.13 installed on your system. This project uses [Poetry](https://python-poetry.org/) for dependency management and package handling, offering a seamless setup and execution experience.
The goal is to enable you to easily set up a multi-agent system that works in unison to produce a podcast, showcasing the potential of integrating AI with practical creativity.

First, if you haven't already, install Poetry:
[Download Sample Podcast](https://github.com/tonykipkemboi/CrewAI-NotebookLM-Clone-Demo/blob/main/output/podcast_20241019_125508.mp3)

```bash
pip install poetry
```
## 📖 Project Overview

**CrewaiNotebooklmClone** is a multi-agent AI system built to streamline the podcast production process. The agents in this project:

1. **Script Writing Agent**: Summarizes content and generates a two-speaker conversational script, making technical content more accessible and engaging.
2. **Audio Production Agent**: Converts the generated script into audio, utilizing natural-sounding voices for a lifelike experience.
3. **Podcast Merging Agent**: Merges the individual audio clips into a final podcast file, ready for publication.

This project effectively uses tools such as **Cerebras** for blazing fast inference using **Llama3.1-70B model** for language generation and **ElevenLabs API** for speech synthesis.

Next, navigate to your project directory and install the dependencies:
## 🛠️ Features

- **Conversational Script Writing**: Generates lively, engaging conversations between two podcast hosts, using Cerebras API.
- **Voice Synthesis**: Produces natural-sounding audio files for the generated script using ElevenLabs.
- **Audio Merging**: Merges individual audio segments into a cohesive podcast episode.
- **Flexible Configuration**: Easily modify agent and task configurations to customize outputs.

## 🚀 Running the Project

To initiate your crew of AI agents and start executing tasks, run the following command from the root directory:

1. First lock the dependencies and install them by using the CLI command:
```bash
crewai install
```
### Customizing

**Add your `OPENAI_API_KEY` into the `.env` file**
**Add your `CEREBRAS_API_KEY` & `ELEVENLABS_API_KEY` into the `.env` file**

- Modify `src/crewai_notebooklm_clone/config/agents.yaml` to define your agents
- Modify `src/crewai_notebooklm_clone/config/tasks.yaml` to define your tasks
- Modify `src/crewai_notebooklm_clone/crew.py` to add your own logic, tools and specific args
- Modify `src/crewai_notebooklm_clone/main.py` to add custom inputs for your agents and tasks

## Running the Project

To kickstart your crew of AI agents and begin task execution, run this from the root folder of your project:

```bash
$ crewai run
```

This command initializes the crewai-notebooklm-clone Crew, assembling the agents and assigning them tasks as defined in your configuration.
This command kicks off the **CrewaiNotebooklmClone** Crew, assembling the agents and assigning them tasks according to the configuration. In its default form, the crew will:

1. Summarize a provided text into key points.
2. Generate a podcast script featuring Chuckles (the technical host) and Giggles (the curious co-host).
3. Convert the script into audio files.
4. Merge the audio files into a final podcast episode.

## 🧠 Understanding the Agents and Tasks

This crew consists of three main agents, each with specific tasks:

1. **Summarizer and Conversational Script Writer**

- **Role**: Senior Content Summarizer
- **Goal**: Summarize content and create a conversational script for a podcast featuring two speakers.

2. **Audio Producer**

- **Role**: Audio Producer
- **Goal**: Convert the generated script into audio files using ElevenLabs.

3. **Podcast Audio Producer**

- **Role**: Podcast Audio Producer
- **Goal**: Merge the individual audio clips into a final podcast episode.

The collaboration between these agents enables a smooth workflow from concept to audio production.

This example, unmodified, will run the create a `report.md` file with the output of a research on LLMs in the root folder.
## 🧰 Customizing the Workflow

## Understanding Your Crew
To tailor the workflow for your specific needs, you can:

The crewai-notebooklm-clone Crew is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your crew.
- Modify the `agents.yaml` and `tasks.yaml` configuration files.
- Update the script writing prompts in `custom_tool.py` to adjust the tone or style of the generated podcast content.
- Integrate additional tools if necessary to expand the capabilities of your crew.

## Support
## 🎗️ Support and Community

For support, questions, or feedback regarding the CrewaiNotebooklmClone Crew or crewAI.
- Visit our [documentation](https://docs.crewai.com)
- Reach out to us through our [GitHub repository](https://github.com/joaomdmoura/crewai)
- [Join our Discord](https://discord.com/invite/X4JWnZnxPb)
- [Chat with our docs](https://chatg.pt/DWjSBZn)
For any questions, feedback, or support, feel free to reach out:

Let's create wonders together with the power and simplicity of crewAI.
- Visit the [CrewAI Documentation](https://docs.crewai.com) for detailed guides and references.
- [Join our Discord](https://discord.com/invite/X4JWnZnxPb) to engage with the CrewAI community.
- For any issues or contributions, check out the [GitHub repository](https://github.com/joaomdmoura/crewai).
- Follow me on X [@tonykipkemboi]\([https://www.x.com/tonykipkemboi](https://www.x.com/tonykipkemboi))
Binary file modified output/audio-files/0_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/10_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/11_Chuckles.mp3
Binary file not shown.
Binary file modified output/audio-files/12_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/13_Chuckles.mp3
Binary file not shown.
Binary file added output/audio-files/14_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/1_Chuckles.mp3
Binary file not shown.
Binary file modified output/audio-files/2_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/3_Chuckles.mp3
Binary file not shown.
Binary file modified output/audio-files/4_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/5_Chuckles.mp3
Binary file not shown.
Binary file modified output/audio-files/6_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/7_Chuckles.mp3
Binary file not shown.
Binary file modified output/audio-files/8_Giggles.mp3
Binary file not shown.
Binary file modified output/audio-files/9_Chuckles.mp3
Binary file not shown.
Binary file removed output/podcast_20241019_005716.mp3
Binary file not shown.
Binary file added output/podcast_20241019_125508.mp3
Binary file not shown.
74 changes: 60 additions & 14 deletions output/script.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
[
{"speaker": "Giggles", "text": "Welcome to Brainy Banter with Chuckles and Giggles! Today, we're venturing into the mysterious realm of black holes. Buckle up, folks!"},
{"speaker": "Chuckles", "text": "That's right, Giggles! Black holes are definitely a mind-bending topic. Let's start with the basics. What do you find most fascinating about black holes?"},
{"speaker": "Giggles", "text": "Well, Chuckles, I think it's the fact that they're both incredibly common and yet, utterly extraordinary. I mean, did you know that giant black holes reside at the centers of most large galaxies?"},
{"speaker": "Chuckles", "text": "Yeah, that's right! And it's not just a few galaxies we're talking about. There are over 200 billion galaxies out there, each containing millions of stellar- or star-sized black holes. That's a staggering number!"},
{"speaker": "Giggles", "text": "I know, right? It's like, what are the chances? And then there's this prediction that in about 40 billion years, when the universe is three times its current age, black holes will be all that's left. Can you wrap your head around that?"},
{"speaker": "Chuckles", "text": "Hmm, that's a pretty wild idea. I mean, think about it. All the stars, planets, and galaxies we see today will be gone, and only these... these black holes will remain. It's like, what will they be doing, just floating around in space?"},
{"speaker": "Giggles", "text": "Exactly! And it's not just a few black holes, either. We're talking about an estimated 10 billion billion of them. I mean, what even is that number?"},
{"speaker": "Chuckles", "text": "Ha! Yeah, it's a real tongue-twister, isn't it? But seriously, Giggles, what do you think is the most significant implication of this prediction?"},
{"speaker": "Giggles", "text": "Umm, that's a great question, Chuckles. I think it's the fact that black holes will be the ultimate legacy of our universe. Like, all our stars, our planets, our civilizations... everything will be gone, and only these black holes will remain as a testament to what once was."},
{"speaker": "Chuckles", "text": "Wow, that's a profound point, Giggles. And it's not just about the sheer number of black holes, either. It's about what they represent: the ultimate power and mystery of the universe."},
{"speaker": "Giggles", "text": "Exactly, Chuckles! And that's what makes black holes so fascinating, don't you think? They're this constant reminder of how much we still don't know about the universe and its many secrets."},
{"speaker": "Chuckles", "text": "Absolutely, Giggles. And that's why we're so excited to be exploring this topic with our listeners today. Thanks for tuning in, everyone!"},
{"speaker": "Giggles", "text": "Yeah, thanks for joining us on this brainy banter, folks! Don't forget to subscribe to our podcast for more mind-bending conversations. Until next time, stay curious!"},
{"speaker": "Chuckles", "text": "Later, everyone!"}
{
"speaker": "Giggles",
"text": "Welcome to Brainy Banter, I'm Giggles! Today, we're going to talk about one of the most mind-blowing topics in the universe - black holes! I'm super excited, and I'm not alone. Joining me is Chuckles, our resident expert on all things cosmic."
},
{
"speaker": "Chuckles",
"text": "Hey, Giggles! Yeah, black holes are indeed mind-blowing. And what's crazy is that they're not just these rare, exotic objects. They're actually pretty common."
},
{
"speaker": "Giggles",
"text": "Whoa, really? That's not what I expected. I mean, I thought black holes were like, super rare and only found in certain parts of the universe."
},
{
"speaker": "Chuckles",
"text": "Nope! According to the latest estimates, there are over 200 billion galaxies in the observable universe, and each one of those galaxies is thought to have a giant black hole at its center. That's a lot of black holes!"
},
{
"speaker": "Giggles",
"text": "That is a lot of black holes! And these giant black holes, how big are they exactly? You mentioned they're giant, but what does that even mean?"
},
{
"speaker": "Chuckles",
"text": "Well, these supermassive black holes can have masses millions or even billions of times that of our sun. It's hard to wrap your head around, but they're truly gargantuan objects."
},
{
"speaker": "Giggles",
"text": "That's... just... wow. And what about these stellar-sized black holes? Are they smaller versions of the supermassive ones?"
},
{
"speaker": "Chuckles",
"text": "Exactly! Stellar-sized black holes are formed when individual stars collapse in on themselves. They're much smaller than the supermassive ones, but still pack a lot of gravitational punch."
},
{
"speaker": "Giggles",
"text": "I see. And you said there are about 100 million of these stellar-sized black holes in each galaxy? That's just... uh... a lot of holes in space!"
},
{
"speaker": "Chuckles",
"text": "Ha! Yeah, it is a lot of holes in space. But think about it, Giggles - that means there are approximately 10 billion billion black holes in the observable universe. That's a 1 followed by 19 zeros!"
},
{
"speaker": "Giggles",
"text": "Whoa... my brain just exploded. And, umm, you said that, far into the future, black holes will be all that's left? What does that even mean?"
},
{
"speaker": "Chuckles",
"text": "Well, in about 40 billion years, the universe will be three times its current age, and all the stars will have burned out. According to the calculations of astrophysicists Fred Adams and Gregory Laughlin, at that point, the only objects left in the universe will be black holes."
},
{
"speaker": "Giggles",
"text": "That's... that's just... so profound. It's like, the ultimate cosmic legacy. Thanks for sharing your knowledge with us, Chuckles."
},
{
"speaker": "Chuckles",
"text": "Anytime, Giggles! It's always a blast to talk about mind-bending topics like black holes. Maybe next time we can explore more cosmic curiosities."
},
{
"speaker": "Giggles",
"text": "Sounds like a plan, Chuckles! And that's all the time we have for today. Thanks for tuning in to Brainy Banter, folks! Join us next time for more brain-tickling conversations."
}
]
2 changes: 1 addition & 1 deletion src/crewai_notebooklm_clone/tools/custom_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _run(self, user_input: str) -> str:
"- Your task is to create a lively, engaging conversation between two speakers based on the provided article or text.\n"
"- The dialogue should be at least 25,000 characters long, packed with emotional expression.\n"
"- The speakers are Chuckles (the technical host) and Giggles (the co-host who asks insightful and curious questions).\n"
"- The speakers should alternate turns in the conversation one being technical and the other one asking questions.\n"
"- The speakers should alternate turns in the conversation one being technical.\n"
"- The podcast title is 'Brainy Banter with Chuckles and Giggles.'\n"
"- Keep sentences short and suitable for smooth speech synthesis.\n"
"- Inject energy and enthusiasm into the conversation to keep it engaging.\n"
Expand Down

0 comments on commit c4149ed

Please sign in to comment.