Best Practices Integration into Existing CrewAI Workflow

@Shivang_Goyal,

As I mentioned in this other thread, here are a few ideas on how to organize your instructions:

  • As @igi rightly pointed out, focus on organizing your prompts (Task.description). I also recommend using well-structured Markdown, especially with subheadings, bullet points, and so on. This helps maintain clarity and readability for both humans and LLMs.
  • Regarding your Best Practices document, consider creating a specific section for them where you break down the recommended practices relevant to each task. Not all best practices might apply to every task, so this curation helps maintain focus.
  • Avoid using a tool just to retrieve that file. Generally (and this applies to many situations), tool usage by the LLM should be restricted to scenarios where you can’t determine the necessary information beforehand. Each tool use by the LLM adds an extra step, which increases latency and potentially introduces another source of hallucinations (e.g., improper tool use). If you can provide the information directly in the prompt, that’s preferable.
  • If these Best Practices are crucial for the client, consider creating a dedicated step (either a node in a Flow or an Agent in your process) responsible for verifying that the best practices have been followed, i.e. one agent generates, and another one verifies. This improves the final output’s alignment with your client’s requirements.
  • Even if you adopt a verification step, it’s a good idea for the generating agent to already be aware of the best practices. In other words, make sure to provide the best practices to both the generating agents and (obviously) the ones that verify/enforce them.

I hope these general ideas help you deliver a great result.

1 Like