Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
Fix: Langtrace Docs (#1297)
Ali Waleed72fb109147ab
diff --git a/docs/assets/crewai-langtrace-spans.png b/docs/assets/crewai-langtrace-spans.pngdeleted file mode 100644index 58632ea68..000000000Binary files a/docs/assets/crewai-langtrace-spans.png and /dev/null differdiff --git a/docs/assets/crewai-langtrace-stats.png b/docs/assets/crewai-langtrace-stats.pngdeleted file mode 100644index ea1f60e97..000000000Binary files a/docs/assets/crewai-langtrace-stats.png and /dev/null differdiff --git a/docs/assets/langtrace1.png b/docs/assets/langtrace1.pngnew file mode 100644index 000000000..e1d7df418Binary files /dev/null and b/docs/assets/langtrace1.png differdiff --git a/docs/assets/langtrace2.png b/docs/assets/langtrace2.pngnew file mode 100644index 000000000..22fe43578Binary files /dev/null and b/docs/assets/langtrace2.png differdiff --git a/docs/assets/langtrace3.png b/docs/assets/langtrace3.pngnew file mode 100644index 000000000..77eefbf2bBinary files /dev/null and b/docs/assets/langtrace3.png differdiff --git a/docs/how-to/Langtrace-Observability.md b/docs/how-to/Langtrace-Observability.mdindex 29949bbae..168f7e340 100644--- a/docs/how-to/Langtrace-Observability.md+++ b/docs/how-to/Langtrace-Observability.md@@ -7,10 +7,14 @@ description: How to monitor cost, latency, and performance of CrewAI Agents usinLangtrace is an open-source, external tool that helps you set up observability and evaluations for Large Language Models (LLMs), LLM frameworks, and Vector Databases. While not built directly into CrewAI, Langtrace can be used alongside CrewAI to gain deep visibility into the cost, latency, and performance of your CrewAI Agents. This integration allows you to log hyperparameters, monitor performance regressions, and establish a process for continuous improvement of your Agents.++++## Setup Instructions1. Sign up for [Langtrace](https://langtrace.ai/) by visiting [https://langtrace.ai/signup](https://langtrace.ai/signup).-2. Create a project and generate an API key.+2. Create a project, set the project type to crewAI & generate an API key.3. Install Langtrace in your CrewAI project using the following commands:```bash@@ -32,58 +36,29 @@ langtrace.init(api_key='<LANGTRACE_API_KEY>')from crewai import Agent, Task, Crew```-2. Create your CrewAI agents and tasks as usual.--3. Use Langtrace's tracking functions to monitor your CrewAI operations. For example:--```python-with langtrace.trace("CrewAI Task Execution"):- result = crew.kickoff()-```-### Features and Their Application to CrewAI1. **LLM Token and Cost Tracking**+- Monitor the token usage and associated costs for each CrewAI agent interaction.- - Example:- ```python- with langtrace.trace("Agent Interaction"):- agent_response = agent.execute(task)- ```2. **Trace Graph for Execution Steps**+- Visualize the execution flow of your CrewAI tasks, including latency and logs.- Useful for identifying bottlenecks in your agent workflows.3. **Dataset Curation with Manual Annotation**+- Create datasets from your CrewAI task outputs for future training or evaluation.- - Example:- ```python- langtrace.log_dataset_item(task_input, agent_output, {"task_type": "research"})- ```4. **Prompt Versioning and Management**+- Keep track of different versions of prompts used in your CrewAI agents.- Useful for A/B testing and optimizing agent performance.5. **Prompt Playground with Model Comparisons**+- Test and compare different prompts and models for your CrewAI agents before deployment.6. **Testing and Evaluations**- Set up automated tests for your CrewAI agents and tasks.- - Example:- ```python- langtrace.evaluate(agent_output, expected_output, "accuracy")- ```--## Monitoring New CrewAI Features--CrewAI has introduced several new features that can be monitored using Langtrace:--1. **Code Execution**: Monitor the performance and output of code executed by agents.- ```python- with langtrace.trace("Agent Code Execution"):- code_output = agent.execute_code(code_snippet)- ```--2. **Third-party Agent Integration**: Track interactions with LlamaIndex, LangChain, and Autogen agents.\ No newline at end of file