Use crewAI and add a custom tool to store notes in Obsidian



AI Summary

# Custom Tool Creation Tutorial Summary  
  
## Overview  
- Tutorial on creating a custom tool in [[Crew AI]] for adding search results as notes in [[Obsidian]].  
- Comparison of tool use with Chat GPT, local LLMS, and surprises encountered.  
  
## Crew AI Framework  
- Multi-agent framework allowing for complex problem-solving.  
- Offers control over task assignment to agents.  
- Core concepts include defining agent blueprints, tasks, and using tools from Blank Chain or custom tools.  
  
## Custom Tool Development  
- Tools are functions used by agents to perform actions.  
- Custom tools can be created to extend functionality.  
- Tool components include name, description, and argument schema.  
- Prefer single input tools for compatibility with many agents.  
- Tool decorator simplifies custom tool definition using function names and docstrings.  
  
## Implementation Steps  
1. Create a new directory and initialize a Python environment.  
2. Install necessary packages (`langchain` and `crewai`).  
3. Create a `tools` package with `__init__.py` and `custom_tools.py`.  
4. Define custom tools using the `@tool` decorator.  
5. Test the tool by writing a `main.py` file and running it.  
  
## Crew AI Extension  
- Default AI agent uses OpenAI's Chat GPT-4.  
- Define agents with roles, goals, and backstories.  
- Assign custom tools to agents.  
- Define tasks and assign them to specific agents.  
- Set up a crew with agents and tasks, then run with `crew.kickoff`.  
  
## Comparison with Other Models  
- Test cheaper models like Chat GPT-3.5 Turbo for cost efficiency.  
- Explore local LLMS like Mistral and Nexus Raven using AMA.  
- Encounter issues with formatting and content completeness.  
- Prompt engineering can improve results but may introduce new issues.  
  
## Conclusion  
- Custom tools can enhance Crew AI's capabilities.  
- No-code developers may find current LLMS not yet production-ready.  
- Programmers should leverage programming logic to save on tokens and time.  
- LLMS excel in specific areas like semantic search and summarization.