what are the best practices and folder structure f...
# ask-ai
o
what are the best practices and folder structure for managing multiple agents in a single repo?
t
Thanks for reaching out, fernando. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Managing multiple agents in a single repository can feel a bit overwhelming, but I’m here to help you navigate it smoothly! Here are some friendly best practices and folder structure ideas that might make things easier for you: • Monorepo Structure: It’s super helpful to use a monorepo structure to keep everything centralized. For example, you can organize packages in a top-level directory like
packages/
or
livekit-agents/
for your core framework code, and
livekit-plugins/
for any plugins. • Separation of Concerns: Keeping core functionality, plugins, and examples in separate directories really helps with clarity. Something like this works well: ◦ `agents/`: This is where your core framework code lives ◦ `plugins/`: Perfect for AI service integrations like OpenAI or Deepgram ◦ `examples/`: Great spot for sample agent implementations • Specialized Agents: Organizing agents by their specialization can make your project more manageable. You can have a base agent class to share common features, while customizing each agent with different instructions and tools. • Prompt Management: It’s a good idea to keep agent instructions or prompt files in their own directory, such as
prompts/
, so everything stays neat and easy to find. • Dependency Management: Using centralized tools like pnpm or uv for managing dependencies can really streamline updates and keep everything consistent across your agents. • Examples by Use Case: Organizing example implementations by use case inside the
examples/
directory can provide clear, practical guidance for different scenarios. Following these friendly tips can help you maintain a clean, scalable, and reusable codebase, making the whole process of managing multiple agents much more enjoyable. If you have any questions or want to dive deeper into any of these points, I’m here to help! Sources: docs/index.yaml | main.py | pnpm-workspace.yaml | Python Agents Core Architecture | livekit/livekit_composite | DeepWiki | Repository Synchronization System | livekit/livekit_composite | DeepWiki