diff --git a/.github/workflows/build-uv-cache.yml b/.github/workflows/build-uv-cache.yml index 3e5028eb7..06835d14c 100644 --- a/.github/workflows/build-uv-cache.yml +++ b/.github/workflows/build-uv-cache.yml @@ -28,7 +28,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: ${{ matrix.python-version }} enable-cache: false diff --git a/.github/workflows/generate-tool-specs.yml b/.github/workflows/generate-tool-specs.yml index aa3c1bd5d..717135938 100644 --- a/.github/workflows/generate-tool-specs.yml +++ b/.github/workflows/generate-tool-specs.yml @@ -35,7 +35,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: "3.12" enable-cache: true diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ecef1d1f6..b62b0eba5 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -6,7 +6,24 @@ permissions: contents: read jobs: - lint: + changes: + name: Detect changes + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - '!docs/**' + - '!**/*.md' + + lint-run: + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -26,7 +43,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: "3.11" enable-cache: false @@ -48,3 +65,23 @@ jobs: ~/.local/share/uv .venv key: uv-main-py3.11-${{ hashFiles('uv.lock') }} + + # Summary job to provide single status for branch protection + lint: + name: lint + runs-on: ubuntu-latest + needs: [changes, lint-run] + if: always() + steps: + - name: Check results + run: | + if [ "${{ needs.changes.outputs.code }}" != "true" ]; then + echo "Docs-only change, skipping lint" + exit 0 + fi + if [ "${{ needs.lint-run.result }}" == "success" ]; then + echo "Lint passed" + else + echo "Lint failed" + exit 1 + fi diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 309014dfe..2cfadad15 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -95,7 +95,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: "3.12" enable-cache: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5097231b9..f2b1bc1b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -65,7 +65,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: "3.12" enable-cache: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d8054ff4..71a7b801a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,8 +6,25 @@ permissions: contents: read jobs: - tests: + changes: + name: Detect changes + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - '!docs/**' + - '!**/*.md' + + tests-matrix: name: tests (${{ matrix.python-version }}) + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -36,7 +53,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: ${{ matrix.python-version }} enable-cache: false @@ -98,3 +115,23 @@ jobs: ~/.local/share/uv .venv key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }} + + # Summary job to provide single status for branch protection + tests: + name: tests + runs-on: ubuntu-latest + needs: [changes, tests-matrix] + if: always() + steps: + - name: Check results + run: | + if [ "${{ needs.changes.outputs.code }}" != "true" ]; then + echo "Docs-only change, skipping tests" + exit 0 + fi + if [ "${{ needs.tests-matrix.result }}" == "success" ]; then + echo "All tests passed" + else + echo "Tests failed" + exit 1 + fi diff --git a/.github/workflows/type-checker.yml b/.github/workflows/type-checker.yml index 3dd77187f..8d88d4b6a 100644 --- a/.github/workflows/type-checker.yml +++ b/.github/workflows/type-checker.yml @@ -6,8 +6,25 @@ permissions: contents: read jobs: + changes: + name: Detect changes + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + code: + - '!docs/**' + - '!**/*.md' + type-checker-matrix: name: type-checker (${{ matrix.python-version }}) + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest strategy: fail-fast: false @@ -33,7 +50,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: ${{ matrix.python-version }} enable-cache: false @@ -57,14 +74,18 @@ jobs: type-checker: name: type-checker runs-on: ubuntu-latest - needs: type-checker-matrix + needs: [changes, type-checker-matrix] if: always() steps: - - name: Check matrix results + - name: Check results run: | - if [ "${{ needs.type-checker-matrix.result }}" == "success" ] || [ "${{ needs.type-checker-matrix.result }}" == "skipped" ]; then - echo "✅ All type checks passed" + if [ "${{ needs.changes.outputs.code }}" != "true" ]; then + echo "Docs-only change, skipping type checks" + exit 0 + fi + if [ "${{ needs.type-checker-matrix.result }}" == "success" ]; then + echo "All type checks passed" else - echo "❌ Type checks failed" + echo "Type checks failed" exit 1 fi diff --git a/.github/workflows/update-test-durations.yml b/.github/workflows/update-test-durations.yml index 13f1ecd69..4084fb64d 100644 --- a/.github/workflows/update-test-durations.yml +++ b/.github/workflows/update-test-durations.yml @@ -40,7 +40,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 with: - version: "0.8.4" + version: "0.11.3" python-version: ${{ matrix.python-version }} enable-cache: false diff --git a/.github/workflows/vulnerability-scan.yml b/.github/workflows/vulnerability-scan.yml new file mode 100644 index 000000000..90b289d79 --- /dev/null +++ b/.github/workflows/vulnerability-scan.yml @@ -0,0 +1,105 @@ +name: Vulnerability Scan + +on: + pull_request: + push: + branches: [main] + schedule: + # Run weekly on Monday at 9:00 UTC + - cron: '0 9 * * 1' + +permissions: + contents: read + +jobs: + pip-audit: + name: pip-audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Restore global uv cache + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: | + ~/.cache/uv + ~/.local/share/uv + .venv + key: uv-main-py3.11-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-main-py3.11- + + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + version: "0.11.3" + python-version: "3.11" + enable-cache: false + + - name: Install dependencies + run: uv sync --all-groups --all-extras --no-install-project + + - name: Install pip-audit + run: uv pip install pip-audit + + - name: Run pip-audit + run: | + uv run pip-audit --desc --aliases --skip-editable --format json --output pip-audit-report.json \ + --ignore-vuln CVE-2025-69872 \ + --ignore-vuln CVE-2026-25645 \ + --ignore-vuln CVE-2026-27448 \ + --ignore-vuln CVE-2026-27459 \ + --ignore-vuln PYSEC-2023-235 + # Ignored CVEs: + # CVE-2025-69872 - diskcache 5.6.3: no fix available (latest version) + # CVE-2026-25645 - requests 2.32.5: fix requires 2.33.0, blocked by crewai-tools ~=2.32.5 pin + # CVE-2026-27448 - pyopenssl 25.3.0: fix requires 26.0.0, blocked by snowflake-connector-python <26.0.0 pin + # CVE-2026-27459 - pyopenssl 25.3.0: same as above + # PYSEC-2023-235 - couchbase: fixed in 4.6.0 (already upgraded), advisory not yet updated + continue-on-error: true + + - name: Display results + if: always() + run: | + if [ -f pip-audit-report.json ]; then + echo "## pip-audit Results" >> $GITHUB_STEP_SUMMARY + echo '```json' >> $GITHUB_STEP_SUMMARY + cat pip-audit-report.json | python3 -m json.tool >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + # Fail if vulnerabilities found + python3 -c " + import json, sys + with open('pip-audit-report.json') as f: + data = json.load(f) + vulns = [d for d in data.get('dependencies', []) if d.get('vulns')] + if vulns: + print(f'::error::Found vulnerabilities in {len(vulns)} package(s)') + for v in vulns: + for vuln in v['vulns']: + print(f' - {v[\"name\"]}=={v[\"version\"]}: {vuln[\"id\"]}') + sys.exit(1) + print('No known vulnerabilities found') + " + else + echo "::error::pip-audit failed to produce a report. Check the pip-audit step logs." + exit 1 + fi + + - name: Upload pip-audit report + if: always() + uses: actions/upload-artifact@v4 + with: + name: pip-audit-report + path: pip-audit-report.json + + - name: Save uv caches + if: steps.cache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + ~/.cache/uv + ~/.local/share/uv + .venv + key: uv-main-py3.11-${{ hashFiles('uv.lock') }} + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index defe87b5c..51d720ebf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,9 +21,17 @@ repos: types: [python] exclude: ^(lib/crewai/src/crewai/cli/templates/|lib/crewai/tests/|lib/crewai-tools/tests/|lib/crewai-files/tests/) - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.3 + rev: 0.11.3 hooks: - id: uv-lock + - repo: local + hooks: + - id: pip-audit + name: pip-audit + entry: bash -c 'source .venv/bin/activate && uv run pip-audit --skip-editable --ignore-vuln CVE-2025-69872 --ignore-vuln CVE-2026-25645 --ignore-vuln CVE-2026-27448 --ignore-vuln CVE-2026-27459 --ignore-vuln PYSEC-2023-235' -- + language: system + pass_filenames: false + stages: [pre-push, manual] - repo: https://github.com/commitizen-tools/commitizen rev: v4.10.1 hooks: diff --git a/docs/ar/changelog.mdx b/docs/ar/changelog.mdx index 277a14f1f..b151cf950 100644 --- a/docs/ar/changelog.mdx +++ b/docs/ar/changelog.mdx @@ -4,6 +4,447 @@ description: "تحديثات المنتج والتحسينات وإصلاحات icon: "clock" mode: "wide" --- + + ## v1.14.2a4 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.2a4) + + ## ما الذي تغير + + ### الميزات + - إضافة تلميحات استئناف إلى إصدار أدوات المطورين عند الفشل + + ### إصلاحات الأخطاء + - إصلاح توجيه وضع الصرامة إلى واجهة برمجة تطبيقات Bedrock Converse + - إصلاح إصدار pytest إلى 9.0.3 لثغرة الأمان GHSA-6w46-j5rx-g56g + - رفع الحد الأدنى لـ OpenAI إلى >=2.0.0 + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.2a3 + + ## المساهمون + + @greysonlalonde + + + + + ## v1.14.2a3 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.2a3) + + ## ما الذي تغير + + ### الميزات + - إضافة واجهة سطر الأوامر للتحقق من النشر + - تحسين سهولة استخدام تهيئة LLM + + ### إصلاحات الأخطاء + - تجاوز pypdf و uv إلى إصدارات مصححة لـ CVE-2026-40260 و GHSA-pjjw-68hj-v9mw + - ترقية requests إلى >=2.33.0 لمعالجة ثغرة ملف مؤقت CVE + - الحفاظ على معلمات استدعاء أداة Bedrock من خلال إزالة القيمة الافتراضية الصحيحة + - تنظيف مخططات الأدوات لوضع صارم + - إصلاح اختبار تسلسل تضمين MemoryRecord + + ### الوثائق + - تنظيف لغة A2A الخاصة بالمؤسسات + - إضافة وثائق ميزات A2A الخاصة بالمؤسسات + - تحديث وثائق A2A الخاصة بالمصادر المفتوحة + - تحديث سجل التغييرات والإصدار لـ v1.14.2a2 + + ## المساهمون + + @Yanhu007, @greysonlalonde + + + + + ## v1.14.2a2 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.2a2) + + ## ما الذي تغير + + ### الميزات + - إضافة واجهة مستخدم نصية لنقطة التحقق مع عرض شجري، ودعم التفرع، ومدخلات/مخرجات قابلة للتعديل + - إثراء تتبع رموز LLM مع رموز الاستدلال ورموز إنشاء التخزين المؤقت + - إضافة معلمة `from_checkpoint` إلى طرق الانطلاق + - تضمين `crewai_version` في نقاط التحقق مع إطار عمل الهجرة + - إضافة تفرع نقاط التحقق مع تتبع السلالة + + ### إصلاحات الأخطاء + - إصلاح توجيه الوضع الصارم إلى مزودي Anthropic وBedrock + - تعزيز NL2SQLTool مع وضع القراءة فقط الافتراضي، والتحقق من الاستعلامات، والاستعلامات المعلمة + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.2a1 + + ## المساهمون + + @alex-clawd, @github-actions[bot], @greysonlalonde, @lucasgomide + + + + + ## v1.14.2a1 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.2a1) + + ## ما الذي تغير + + ### إصلاحات الأخطاء + - إصلاح إصدار حدث flow_finished بعد استئناف HITL + - إصلاح إصدار التشفير إلى 46.0.7 لمعالجة CVE-2026-39892 + + ### إعادة هيكلة + - إعادة هيكلة لاستخدام I18N_DEFAULT المشترك + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.1 + + ## المساهمون + + @greysonlalonde + + + + + ## v1.14.1 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.1) + + ## ما الذي تغير + + ### الميزات + - إضافة متصفح TUI لنقاط التفتيش غير المتزامنة + - إضافة دالة aclose()/close() ومدير سياق غير متزامن لمخرجات البث + + ### إصلاحات الأخطاء + - إصلاح التعبير النمطي لزيادة إصدار pyproject.toml + - تنظيف أسماء الأدوات في مرشحات زخرفة الخطاف + - إصلاح تسجيل معالجات نقاط التفتيش عند إنشاء CheckpointConfig + - رفع إصدار transformers إلى 5.5.0 لحل CVE-2026-1839 + - إزالة غلاف FilteredStream لـ stdout/stderr + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.1rc1 + + ### إعادة الهيكلة + - استبدال القائمة المحظورة الثابتة باستبعاد حقل BaseTool الديناميكي في توليد المواصفات + - استبدال التعبير النمطي بـ tomlkit في واجهة سطر أوامر أدوات التطوير + - استخدام كائن PRINTER المشترك + - جعل BaseProvider نموذجاً أساسياً مع مميز نوع المزود + + ## المساهمون + + @greysonlalonde, @iris-clawd, @joaomdmoura, @lorenzejay + + + + + ## v1.14.1rc1 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.1rc1) + + ## ما الذي تغير + + ### الميزات + - إضافة متصفح TUI لنقطة التحقق غير المتزامنة + - إضافة aclose()/close() ومدير سياق غير متزامن لمخرجات البث + + ### إصلاحات الأخطاء + - إصلاح زيادة إصدارات pyproject.toml باستخدام التعبيرات العادية + - تنظيف أسماء الأدوات في مرشحات ديكور المكونات + - زيادة إصدار transformers إلى 5.5.0 لحل CVE-2026-1839 + - تسجيل معالجات نقطة التحقق عند إنشاء CheckpointConfig + + ### إعادة الهيكلة + - استبدال القائمة المحظورة الثابتة باستبعاد حقل BaseTool الديناميكي في توليد المواصفات + - استبدال التعبيرات العادية بـ tomlkit في واجهة سطر الأوامر devtools + - استخدام كائن PRINTER المشترك + - جعل BaseProvider نموذجًا أساسيًا مع مميز نوع المزود + - إزالة غلاف stdout/stderr لـ FilteredStream + - إزالة flow/config.py غير المستخدمة + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.0 + + ## المساهمون + + @greysonlalonde, @iris-clawd, @joaomdmoura + + + + + ## v1.14.0 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.0) + + ## ما الذي تغير + + ### الميزات + - إضافة أوامر CLI لقائمة/معلومات نقاط التحقق + - إضافة guardrail_type و name لتمييز التتبع + - إضافة SqliteProvider لتخزين نقاط التحقق + - إضافة CheckpointConfig للتسجيل التلقائي لنقاط التحقق + - تنفيذ تسجيل حالة وقت التشغيل، نظام الأحداث، وإعادة هيكلة المنفذ + + ### إصلاحات الأخطاء + - إضافة حماية من SSRF وتجاوز المسار + - إضافة التحقق من المسار وعنوان URL لأدوات RAG + - استبعاد متجهات التضمين من تسلسل الذاكرة لتوفير الرموز + - التأكد من وجود دليل الإخراج قبل الكتابة في قالب التدفق + - رفع litellm إلى >=1.83.0 لمعالجة CVE-2026-35030 + - إزالة حقل فهرسة SEO الذي يتسبب في عرض الصفحة العربية بشكل غير صحيح + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.0 + - تحديث أدلة البدء السريع والتثبيت لتحسين الوضوح + - إضافة قسم مزودي التخزين، تصدير JsonProvider + - إضافة دليل علامة AMP التدريبية + + ### إعادة الهيكلة + - تنظيف واجهة برمجة تطبيقات نقاط التحقق + - إزالة CodeInterpreterTool وإهمال معلمات تنفيذ الكود + + ## المساهمون + + @alex-clawd, @github-actions[bot], @greysonlalonde, @iris-clawd, @joaomdmoura, @lorenzejay, @lucasgomide + + + + + ## v1.14.0a4 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.0a4) + + ## ما الذي تغير + + ### الميزات + - إضافة guardrail_type و name لتمييز الآثار + - إضافة SqliteProvider لتخزين نقاط التحقق + - إضافة CheckpointConfig للتخزين التلقائي لنقاط التحقق + - تنفيذ نقاط التحقق لحالة التشغيل، نظام الأحداث، وإعادة هيكلة المنفذ + + ### إصلاحات الأخطاء + - استبعاد متجهات التضمين من تسلسل الذاكرة لتوفير الرموز + - رفع litellm إلى >=1.83.0 لمعالجة CVE-2026-35030 + + ### الوثائق + - تحديث أدلة البدء السريع والتثبيت لتحسين الوضوح + - إضافة قسم مقدمي التخزين وتصدير JsonProvider + + ### الأداء + - استخدام JSONB لعمود بيانات نقاط التحقق + + ### إعادة الهيكلة + - إزالة CodeInterpreterTool وإهمال معلمات تنفيذ الكود + + ## المساهمون + + @alex-clawd, @github-actions[bot], @greysonlalonde, @joaomdmoura, @lorenzejay, @lucasgomide + + + + + ## v1.14.0a3 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.0a3) + + ## ما الذي تغير + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.14.0a2 + + ## المساهمون + + @joaomdmoura + + + + + ## v1.14.0a2 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.14.0a2) + + # ملاحظات الإصدار 1.14.0a2 + + ## التعليمات: + - ترجم جميع عناوين الأقسام والوصف بشكل طبيعي + - احتفظ بتنسيق markdown (##، ###، -، إلخ) كما هو + - احتفظ بجميع الأسماء الصحيحة، ومعرفات الشيفرة، وأسماء الفئات، والمصطلحات التقنية دون تغيير + (مثل "CrewAI"، "LiteAgent"، "ChromaDB"، "MCP"، "@username") + - احتفظ بقسم ## المساهمون وأسماء مستخدمي GitHub كما هي + - لا تضف أو تزيل أي محتوى، فقط ترجم + + ## المميزات الجديدة + - تمت إضافة دعم لـ "ChromaDB" لتحسين أداء قاعدة البيانات. + - تحسينات على "LiteAgent" لزيادة الكفاءة. + + ## الإصلاحات + - إصلاح مشكلة تتعلق بـ "MCP" التي كانت تؤدي إلى تعطل التطبيق. + - معالجة الأخطاء المتعلقة بواجهة المستخدم في "CrewAI". + + ## المساهمون + - @username1 + - @username2 + - @username3 + + + + + ## v1.13.0 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0) + + ## ما الذي تغير + + ### الميزات + - إضافة نموذج RuntimeState RootModel لتوحيد تسلسل الحالة + - تعزيز مستمع الأحداث مع نطاقات جديدة للقياس عن أحداث المهارة والذاكرة + - إضافة امتداد A2UI مع دعم v0.8/v0.9، والمخططات، والوثائق + - إصدار بيانات استخدام الرموز في حدث LLMCallCompletedEvent + - تحديث تلقائي لمستودع اختبار النشر أثناء الإصدار + - تحسين مرونة الإصدار المؤسسي وتجربة المستخدم + + ### إصلاحات الأخطاء + - إضافة بيانات اعتماد مستودع الأدوات إلى تثبيت crewai + - إضافة بيانات اعتماد مستودع الأدوات إلى بناء uv في نشر الأدوات + - تمرير بيانات التعريف عبر الإعدادات بدلاً من معلمات الأدوات + - معالجة نماذج GPT-5.x التي لا تدعم معلمة API `stop` + - إضافة GPT-5 وسلسلة o إلى بادئات الرؤية متعددة الوسائط + - مسح ذاكرة التخزين المؤقت uv للحزم التي تم نشرها حديثًا في الإصدار المؤسسي + - تحديد lancedb أقل من 0.30.1 لضمان التوافق مع Windows + - إصلاح مستويات أذونات RBAC لتتناسب مع خيارات واجهة المستخدم الفعلية + - إصلاح عدم الدقة في قدرات الوكيل عبر جميع اللغات + + ### الوثائق + - إضافة فيديو توضيحي لمهارات وكيل البرمجة إلى صفحات البدء + - إضافة دليل شامل لتكوين SSO + - إضافة مصفوفة شاملة لأذونات RBAC ودليل النشر + - تحديث سجل التغييرات والإصدار إلى v1.13.0 + + ### الأداء + - تقليل الحمل الزائد للإطار باستخدام حافلة الأحداث الكسولة، وتخطي التتبع عند تعطيله + + ### إعادة الهيكلة + - تحويل Flow إلى Pydantic BaseModel + - تحويل فئات LLM إلى Pydantic BaseModel + - استبدال InstanceOf[T] بتعليقات نوع عادية + - إزالة دليل LLM الخاص بالطرف الثالث غير المستخدم + + ## المساهمون + + @alex-clawd, @dependabot[bot], @greysonlalonde, @iris-clawd, @joaomdmoura, @lorenzejay, @lucasgomide, @thiagomoretto + + + + + ## v1.13.0a7 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0a7) + + ## ما الذي تغير + + ### الميزات + - إضافة امتداد A2UI مع دعم v0.8/v0.9، والمخططات، والوثائق + + ### إصلاحات الأخطاء + - إصلاح بادئات الرؤية متعددة الأنماط عن طريق إضافة GPT-5 وسلسلة o + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.13.0a6 + + ## المساهمون + + @alex-clawd, @greysonlalonde, @joaomdmoura + + + + + ## v1.13.0a6 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0a6) + + ## ما الذي تغير + + ### الوثائق + - إصلاح مستويات أذونات RBAC لتتوافق مع خيارات واجهة المستخدم الفعلية (#5210) + - تحديث سجل التغييرات والإصدار لـ v1.13.0a5 (#5200) + + ### الأداء + - تقليل عبء العمل على الإطار من خلال تنفيذ حافلة أحداث كسولة وتجاوز التتبع عند تعطيله (#5187) + + ## المساهمون + + @alex-clawd, @joaomdmoura, @lucasgomide + + + + + ## v1.13.0a5 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0a5) + + ## ما الذي تغير + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.13.0a4 + + ## المساهمون + + @greysonlalonde, @joaomdmoura + + + + + ## v1.13.0a4 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0a4) + + ## ما الذي تغير + + ### الوثائق + - تحديث سجل التغييرات والإصدار لـ v1.13.0a3 + + ## المساهمون + + @greysonlalonde + + + + + ## v1.13.0a3 + + [عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.13.0a3) + + ## ما الذي تغير + + ### الميزات + - إصدار بيانات استخدام الرمز في LLMCallCompletedEvent + - استخراج ونشر بيانات الأداة إلى AMP + + ### إصلاح الأخطاء + - التعامل مع نماذج GPT-5.x التي لا تدعم معلمة API `stop` + + ### الوثائق + - إصلاح عدم الدقة في قدرات الوكيل عبر جميع اللغات + - إضافة نظرة عامة على قدرات الوكيل وتحسين وثائق المهارات + - إضافة دليل شامل لتكوين SSO + - تحديث سجل التغييرات والإصدار لـ v1.13.0rc1 + + ### إعادة الهيكلة + - تحويل Flow إلى Pydantic BaseModel + - تحويل فئات LLM إلى Pydantic BaseModel + - استبدال InstanceOf[T] بتعليقات نوع عادية + - إزالة الطرق غير المستخدمة + + ## المساهمون + + @dependabot[bot], @greysonlalonde, @iris-clawd, @lorenzejay, @lucasgomide, @thiagomoretto + + + ## v1.13.0rc1 diff --git a/docs/ar/concepts/agent-capabilities.mdx b/docs/ar/concepts/agent-capabilities.mdx new file mode 100644 index 000000000..f2a1e142c --- /dev/null +++ b/docs/ar/concepts/agent-capabilities.mdx @@ -0,0 +1,147 @@ +--- +title: "قدرات الوكيل" +description: "فهم الطرق الخمس لتوسيع وكلاء CrewAI: الأدوات، MCP، التطبيقات، المهارات، والمعرفة." +icon: puzzle-piece +mode: "wide" +--- + +## نظرة عامة + +يمكن توسيع وكلاء CrewAI بـ **خمسة أنواع مميزة من القدرات**، كل منها يخدم غرضًا مختلفًا. فهم متى تستخدم كل نوع — وكيف يعملون معًا — هو المفتاح لبناء وكلاء فعّالين. + + + + **دوال قابلة للاستدعاء** — تمنح الوكلاء القدرة على اتخاذ إجراءات. البحث على الويب، عمليات الملفات، استدعاءات API، تنفيذ الكود. + + + **خوادم أدوات عن بُعد** — تربط الوكلاء بخوادم أدوات خارجية عبر Model Context Protocol. نفس تأثير الأدوات، لكن مستضافة خارجيًا. + + + **تكاملات المنصة** — تربط الوكلاء بتطبيقات SaaS (Gmail، Slack، Jira، Salesforce) عبر منصة CrewAI. تعمل محليًا مع رمز تكامل المنصة. + + + **خبرة المجال** — تحقن التعليمات والإرشادات والمواد المرجعية في إرشادات الوكلاء. المهارات تخبر الوكلاء *كيف يفكرون*. + + + **حقائق مُسترجعة** — توفر للوكلاء بيانات من المستندات والملفات وعناوين URL عبر البحث الدلالي (RAG). المعرفة تعطي الوكلاء *ما يحتاجون معرفته*. + + + +--- + +## التمييز الأساسي + +أهم شيء يجب فهمه: **هذه القدرات تنقسم إلى فئتين**. + +### قدرات الإجراء (الأدوات، MCP، التطبيقات) + +تمنح الوكلاء القدرة على **فعل أشياء** — استدعاء APIs، قراءة الملفات، البحث على الويب، إرسال رسائل البريد الإلكتروني. عند التنفيذ، تتحول الأنواع الثلاثة إلى نفس التنسيق الداخلي (مثيلات `BaseTool`) وتظهر في قائمة أدوات موحدة يمكن للوكيل استدعاؤها. + +```python +from crewai import Agent +from crewai_tools import SerperDevTool, FileReadTool + +agent = Agent( + role="Researcher", + goal="Find and compile market data", + backstory="Expert market analyst", + tools=[SerperDevTool(), FileReadTool()], # أدوات محلية + mcps=["https://mcp.example.com/sse"], # أدوات خادم MCP عن بُعد + apps=["gmail", "google_sheets"], # تكاملات المنصة +) +``` + +### قدرات السياق (المهارات، المعرفة) + +تُعدّل **إرشادات** الوكيل — بحقن الخبرة أو التعليمات أو البيانات المُسترجعة قبل أن يبدأ الوكيل في التفكير. لا تمنح الوكلاء إجراءات جديدة؛ بل تُشكّل كيف يفكر الوكلاء وما هي المعلومات التي يمكنهم الوصول إليها. + +```python +from crewai import Agent + +agent = Agent( + role="Security Auditor", + goal="Audit cloud infrastructure for vulnerabilities", + backstory="Expert in cloud security with 10 years of experience", + skills=["./skills/security-audit"], # تعليمات المجال + knowledge_sources=[pdf_source, url_source], # حقائق مُسترجعة +) +``` + +--- + +## متى تستخدم ماذا + +| تحتاج إلى... | استخدم | مثال | +| :------------------------------------------------------- | :---------------- | :--------------------------------------- | +| الوكيل يبحث على الويب | **الأدوات** | `tools=[SerperDevTool()]` | +| الوكيل يستدعي API عن بُعد عبر MCP | **MCP** | `mcps=["https://api.example.com/sse"]` | +| الوكيل يرسل بريد إلكتروني عبر Gmail | **التطبيقات** | `apps=["gmail"]` | +| الوكيل يتبع إجراءات محددة | **المهارات** | `skills=["./skills/code-review"]` | +| الوكيل يرجع لمستندات الشركة | **المعرفة** | `knowledge_sources=[pdf_source]` | +| الوكيل يبحث على الويب ويتبع إرشادات المراجعة | **الأدوات + المهارات** | استخدم كليهما معًا | + +--- + +## دمج القدرات + +في الممارسة العملية، غالبًا ما يستخدم الوكلاء **أنواعًا متعددة من القدرات معًا**. إليك مثال واقعي: + +```python +from crewai import Agent +from crewai_tools import SerperDevTool, FileReadTool, CodeInterpreterTool + +# وكيل بحث مجهز بالكامل +researcher = Agent( + role="Senior Research Analyst", + goal="Produce comprehensive market analysis reports", + backstory="Expert analyst with deep industry knowledge", + + # الإجراء: ما يمكن للوكيل فعله + tools=[ + SerperDevTool(), # البحث على الويب + FileReadTool(), # قراءة الملفات المحلية + CodeInterpreterTool(), # تشغيل كود Python للتحليل + ], + mcps=["https://data-api.example.com/sse"], # الوصول لـ API بيانات عن بُعد + apps=["google_sheets"], # الكتابة في Google Sheets + + # السياق: ما يعرفه الوكيل + skills=["./skills/research-methodology"], # كيفية إجراء البحث + knowledge_sources=[company_docs], # بيانات خاصة بالشركة +) +``` + +--- + +## جدول المقارنة + +| الميزة | الأدوات | MCP | التطبيقات | المهارات | المعرفة | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **يمنح الوكيل إجراءات** | ✅ | ✅ | ✅ | ❌ | ❌ | +| **يُعدّل الإرشادات** | ❌ | ❌ | ❌ | ✅ | ✅ | +| **يتطلب كود** | نعم | إعداد فقط | إعداد فقط | Markdown فقط | إعداد فقط | +| **يعمل محليًا** | نعم | يعتمد | نعم (مع متغير بيئة) | غير متاح | نعم | +| **يحتاج مفاتيح API** | لكل أداة | لكل خادم | رمز التكامل | لا | المُضمّن فقط | +| **يُعيَّن على Agent** | `tools=[]` | `mcps=[]` | `apps=[]` | `skills=[]` | `knowledge_sources=[]` | +| **يُعيَّن على Crew** | ❌ | ❌ | ❌ | `skills=[]` | `knowledge_sources=[]` | + +--- + +## تعمّق أكثر + +هل أنت مستعد لمعرفة المزيد عن كل نوع من أنواع القدرات؟ + + + + إنشاء أدوات مخصصة، استخدام كتالوج OSS مع أكثر من 75 خيارًا، تكوين التخزين المؤقت والتنفيذ غير المتزامن. + + + الاتصال بخوادم MCP عبر stdio أو SSE أو HTTP. تصفية الأدوات، تكوين المصادقة. + + + بناء حزم المهارات مع SKILL.md، حقن خبرة المجال، استخدام الكشف التدريجي. + + + إضافة المعرفة من ملفات PDF وCSV وعناوين URL والمزيد. تكوين المُضمّنات والاسترجاع. + + diff --git a/docs/ar/concepts/agents.mdx b/docs/ar/concepts/agents.mdx index fe11b2545..7ae5c668c 100644 --- a/docs/ar/concepts/agents.mdx +++ b/docs/ar/concepts/agents.mdx @@ -250,16 +250,12 @@ analysis_agent = Agent( #### تنفيذ الكود -- `allow_code_execution`: يجب أن يكون True لتشغيل الكود -- `code_execution_mode`: - - `"safe"`: يستخدم Docker (موصى به للإنتاج) - - `"unsafe"`: تنفيذ مباشر (استخدم فقط في بيئات موثوقة) + + `allow_code_execution` و`code_execution_mode` مهجوران. تمت إزالة `CodeInterpreterTool` من `crewai-tools`. استخدم خدمة بيئة معزولة مخصصة مثل [E2B](https://e2b.dev) أو [Modal](https://modal.com) لتنفيذ الكود بأمان. + - - يشغّل هذا صورة Docker افتراضية. إذا أردت تهيئة صورة Docker، - راجع أداة Code Interpreter في قسم الأدوات. أضف أداة - مفسر الكود كأداة في معامل أداة الوكيل. - +- `allow_code_execution` _(مهجور)_: كان يُمكّن تنفيذ الكود المدمج عبر `CodeInterpreterTool`. +- `code_execution_mode` _(مهجور)_: كان يتحكم في وضع التنفيذ (`"safe"` لـ Docker، `"unsafe"` للتنفيذ المباشر). #### الميزات المتقدمة @@ -332,9 +328,9 @@ print(result.raw) ### الأمان وتنفيذ الكود -- عند استخدام `allow_code_execution`، كن حذرًا مع مدخلات المستخدم وتحقق منها دائمًا -- استخدم `code_execution_mode: "safe"` (Docker) في بيئات الإنتاج -- فكّر في تعيين حدود `max_execution_time` مناسبة لمنع الحلقات اللانهائية + + `allow_code_execution` و`code_execution_mode` مهجوران وتمت إزالة `CodeInterpreterTool`. استخدم خدمة بيئة معزولة مخصصة مثل [E2B](https://e2b.dev) أو [Modal](https://modal.com) لتنفيذ الكود بأمان. + ### تحسين الأداء diff --git a/docs/ar/concepts/checkpointing.mdx b/docs/ar/concepts/checkpointing.mdx new file mode 100644 index 000000000..578f04be9 --- /dev/null +++ b/docs/ar/concepts/checkpointing.mdx @@ -0,0 +1,229 @@ +--- +title: Checkpointing +description: حفظ حالة التنفيذ تلقائيا حتى تتمكن الطواقم والتدفقات والوكلاء من الاستئناف بعد الفشل. +icon: floppy-disk +mode: "wide" +--- + + +الـ Checkpointing في اصدار مبكر. قد تتغير واجهات البرمجة في الاصدارات المستقبلية. + + +## نظرة عامة + +يقوم الـ Checkpointing بحفظ حالة التنفيذ تلقائيا اثناء التشغيل. اذا فشل طاقم او تدفق او وكيل اثناء التنفيذ، يمكنك الاستعادة من اخر نقطة حفظ والاستئناف دون اعادة تنفيذ العمل المكتمل. + +## البداية السريعة + +```python +from crewai import Crew, CheckpointConfig + +crew = Crew( + agents=[...], + tasks=[...], + checkpoint=True, # يستخدم الافتراضيات: ./.checkpoints, عند task_completed +) +result = crew.kickoff() +``` + +تتم كتابة ملفات نقاط الحفظ في `./.checkpoints/` بعد اكتمال كل مهمة. + +## التكوين + +استخدم `CheckpointConfig` للتحكم الكامل: + +```python +from crewai import Crew, CheckpointConfig + +crew = Crew( + agents=[...], + tasks=[...], + checkpoint=CheckpointConfig( + location="./my_checkpoints", + on_events=["task_completed", "crew_kickoff_completed"], + max_checkpoints=5, + ), +) +``` + +### حقول CheckpointConfig + +| الحقل | النوع | الافتراضي | الوصف | +|:------|:------|:----------|:------| +| `location` | `str` | `"./.checkpoints"` | مسار ملفات نقاط الحفظ | +| `on_events` | `list[str]` | `["task_completed"]` | انواع الاحداث التي تطلق نقطة حفظ | +| `provider` | `BaseProvider` | `JsonProvider()` | واجهة التخزين | +| `max_checkpoints` | `int \| None` | `None` | الحد الاقصى للملفات؛ يتم حذف الاقدم اولا | + +### الوراثة والانسحاب + +يقبل حقل `checkpoint` في Crew و Flow و Agent قيم `CheckpointConfig` او `True` او `False` او `None`: + +| القيمة | السلوك | +|:-------|:-------| +| `None` (افتراضي) | يرث من الاصل. الوكيل يرث اعدادات الطاقم. | +| `True` | تفعيل بالاعدادات الافتراضية. | +| `False` | انسحاب صريح. يوقف الوراثة من الاصل. | +| `CheckpointConfig(...)` | اعدادات مخصصة. | + +```python +crew = Crew( + agents=[ + Agent(role="Researcher", ...), # يرث checkpoint من الطاقم + Agent(role="Writer", ..., checkpoint=False), # منسحب، بدون نقاط حفظ + ], + tasks=[...], + checkpoint=True, +) +``` + +## الاستئناف من نقطة حفظ + +```python +# استعادة واستئناف +crew = Crew.from_checkpoint("./my_checkpoints/20260407T120000_abc123.json") +result = crew.kickoff() # يستأنف من اخر مهمة مكتملة +``` + +يتخطى الطاقم المستعاد المهام المكتملة ويستأنف من اول مهمة غير مكتملة. + +## يعمل على Crew و Flow و Agent + +### Crew + +```python +crew = Crew( + agents=[researcher, writer], + tasks=[research_task, write_task, review_task], + checkpoint=CheckpointConfig(location="./crew_cp"), +) +``` + +المشغل الافتراضي: `task_completed` (نقطة حفظ واحدة لكل مهمة مكتملة). + +### Flow + +```python +from crewai.flow.flow import Flow, start, listen +from crewai import CheckpointConfig + +class MyFlow(Flow): + @start() + def step_one(self): + return "data" + + @listen(step_one) + def step_two(self, data): + return process(data) + +flow = MyFlow( + checkpoint=CheckpointConfig( + location="./flow_cp", + on_events=["method_execution_finished"], + ), +) +result = flow.kickoff() + +# استئناف +flow = MyFlow.from_checkpoint("./flow_cp/20260407T120000_abc123.json") +result = flow.kickoff() +``` + +### Agent + +```python +agent = Agent( + role="Researcher", + goal="Research topics", + backstory="Expert researcher", + checkpoint=CheckpointConfig( + location="./agent_cp", + on_events=["lite_agent_execution_completed"], + ), +) +result = agent.kickoff(messages=[{"role": "user", "content": "Research AI trends"}]) +``` + +## مزودات التخزين + +يتضمن CrewAI مزودي تخزين لنقاط الحفظ. + +### JsonProvider (افتراضي) + +يكتب كل نقطة حفظ كملف JSON منفصل. + +```python +from crewai import Crew, CheckpointConfig +from crewai.state import JsonProvider + +crew = Crew( + agents=[...], + tasks=[...], + checkpoint=CheckpointConfig( + location="./my_checkpoints", + provider=JsonProvider(), + max_checkpoints=5, + ), +) +``` + +### SqliteProvider + +يخزن جميع نقاط الحفظ في ملف قاعدة بيانات SQLite واحد. + +```python +from crewai import Crew, CheckpointConfig +from crewai.state import SqliteProvider + +crew = Crew( + agents=[...], + tasks=[...], + checkpoint=CheckpointConfig( + location="./.checkpoints.db", + provider=SqliteProvider(), + ), +) +``` + + +## انواع الاحداث + +يقبل حقل `on_events` اي مجموعة من سلاسل انواع الاحداث. الخيارات الشائعة: + +| حالة الاستخدام | الاحداث | +|:---------------|:--------| +| بعد كل مهمة (Crew) | `["task_completed"]` | +| بعد كل طريقة في التدفق | `["method_execution_finished"]` | +| بعد تنفيذ الوكيل | `["agent_execution_completed"]`, `["lite_agent_execution_completed"]` | +| عند اكتمال الطاقم فقط | `["crew_kickoff_completed"]` | +| بعد كل استدعاء LLM | `["llm_call_completed"]` | +| على كل شيء | `["*"]` | + + +استخدام `["*"]` او احداث عالية التردد مثل `llm_call_completed` سيكتب العديد من ملفات نقاط الحفظ وقد يؤثر على الاداء. استخدم `max_checkpoints` للحد من استخدام المساحة. + + +## نقاط الحفظ اليدوية + +للتحكم الكامل، سجل معالج الاحداث الخاص بك واستدع `state.checkpoint()` مباشرة: + +```python +from crewai.events.event_bus import crewai_event_bus +from crewai.events.types.llm_events import LLMCallCompletedEvent + +# معالج متزامن +@crewai_event_bus.on(LLMCallCompletedEvent) +def on_llm_done(source, event, state): + path = state.checkpoint("./my_checkpoints") + print(f"تم حفظ نقطة الحفظ: {path}") + +# معالج غير متزامن +@crewai_event_bus.on(LLMCallCompletedEvent) +async def on_llm_done_async(source, event, state): + path = await state.acheckpoint("./my_checkpoints") + print(f"تم حفظ نقطة الحفظ: {path}") +``` + +وسيط `state` هو `RuntimeState` الذي يتم تمريره تلقائيا بواسطة ناقل الاحداث عندما يقبل المعالج 3 معاملات. يمكنك تسجيل معالجات على اي نوع حدث مدرج في وثائق [Event Listeners](/ar/concepts/event-listener). + +الـ Checkpointing يعمل بافضل جهد: اذا فشلت كتابة نقطة حفظ، يتم تسجيل الخطأ ولكن التنفيذ يستمر دون انقطاع. diff --git a/docs/ar/concepts/skills.mdx b/docs/ar/concepts/skills.mdx index ea883edd1..89f29a90a 100644 --- a/docs/ar/concepts/skills.mdx +++ b/docs/ar/concepts/skills.mdx @@ -1,15 +1,217 @@ --- title: المهارات -description: حزم المهارات المبنية على نظام الملفات التي تحقن السياق في إرشادات الوكيل. +description: حزم المهارات المبنية على نظام الملفات التي تحقن خبرة المجال والتعليمات في إرشادات الوكلاء. icon: bolt mode: "wide" --- ## نظرة عامة -المهارات هي مجلدات مستقلة توفر للوكلاء تعليمات ومراجع وموارد خاصة بالمجال. تُعرّف كل مهارة بملف `SKILL.md` يحتوي على بيانات وصفية YAML ومحتوى Markdown. +المهارات هي مجلدات مستقلة توفر للوكلاء **تعليمات وإرشادات ومواد مرجعية خاصة بالمجال**. تُعرّف كل مهارة بملف `SKILL.md` يحتوي على بيانات وصفية YAML ومحتوى Markdown. -تستخدم المهارات **الكشف التدريجي** — يتم تحميل البيانات الوصفية أولاً، ثم التعليمات الكاملة فقط عند التفعيل، وكتالوجات الموارد فقط عند الحاجة. +عند التفعيل، يتم حقن تعليمات المهارة مباشرة في إرشادات مهمة الوكيل — مما يمنح الوكيل خبرة دون الحاجة لأي تغييرات في الكود. + + +**المهارات ليست أدوات.** هذه هي نقطة الارتباك الأكثر شيوعًا. + +- **المهارات** تحقن *تعليمات وسياق* في إرشادات الوكيل. تخبر الوكيل *كيف يفكر* في مشكلة ما. +- **الأدوات** تمنح الوكيل *دوال قابلة للاستدعاء* لاتخاذ إجراءات (البحث، قراءة الملفات، استدعاء APIs). + +غالبًا ما تحتاج **كليهما**: مهارات للخبرة، وأدوات للإجراء. يتم تكوينهما بشكل مستقل ويُكمّلان بعضهما. + + +--- + +## البداية السريعة + +### 1. إنشاء مجلد المهارة + +``` +skills/ +└── code-review/ + ├── SKILL.md # مطلوب — التعليمات + ├── references/ # اختياري — مستندات مرجعية + │ └── style-guide.md + └── scripts/ # اختياري — سكربتات قابلة للتنفيذ +``` + +### 2. كتابة SKILL.md الخاص بك + +```markdown +--- +name: code-review +description: Guidelines for conducting thorough code reviews with focus on security and performance. +metadata: + author: your-team + version: "1.0" +--- + +## إرشادات مراجعة الكود + +عند مراجعة الكود، اتبع قائمة التحقق هذه: + +1. **الأمان**: تحقق من ثغرات الحقن وتجاوز المصادقة وكشف البيانات +2. **الأداء**: ابحث عن استعلامات N+1 والتخصيصات غير الضرورية والاستدعاءات المحظورة +3. **القابلية للقراءة**: تأكد من وضوح التسمية والتعليقات المناسبة والأسلوب المتسق +4. **الاختبارات**: تحقق من تغطية اختبار كافية للوظائف الجديدة + +### مستويات الخطورة +- **حرج**: ثغرات أمنية، مخاطر فقدان البيانات → حظر الدمج +- **رئيسي**: مشاكل أداء، أخطاء منطقية → طلب تغييرات +- **ثانوي**: مسائل أسلوبية، اقتراحات تسمية → الموافقة مع تعليقات +``` + +### 3. ربطها بوكيل + +```python +from crewai import Agent +from crewai_tools import GithubSearchTool, FileReadTool + +reviewer = Agent( + role="Senior Code Reviewer", + goal="Review pull requests for quality and security issues", + backstory="Staff engineer with expertise in secure coding practices.", + skills=["./skills"], # يحقن إرشادات المراجعة + tools=[GithubSearchTool(), FileReadTool()], # يسمح للوكيل بقراءة الكود +) +``` + +الوكيل الآن لديه **خبرة** (من المهارة) و**قدرات** (من الأدوات) معًا. + +--- + +## المهارات + الأدوات: العمل معًا + +إليك أنماط شائعة توضح كيف تُكمّل المهارات والأدوات بعضهما: + +### النمط 1: مهارات فقط (خبرة المجال، بدون إجراءات مطلوبة) + +استخدم عندما يحتاج الوكيل لتعليمات محددة لكن لا يحتاج لاستدعاء خدمات خارجية: + +```python +agent = Agent( + role="Technical Writer", + goal="Write clear API documentation", + backstory="Expert technical writer", + skills=["./skills/api-docs-style"], # إرشادات وقوالب الكتابة + # لا حاجة لأدوات — الوكيل يكتب بناءً على السياق المقدم +) +``` + +### النمط 2: أدوات فقط (إجراءات، بدون خبرة خاصة) + +استخدم عندما يحتاج الوكيل لاتخاذ إجراءات لكن لا يحتاج لتعليمات مجال محددة: + +```python +from crewai_tools import SerperDevTool, ScrapeWebsiteTool + +agent = Agent( + role="Web Researcher", + goal="Find information about a topic", + backstory="Skilled at finding information online", + tools=[SerperDevTool(), ScrapeWebsiteTool()], # يمكنه البحث والاستخراج + # لا حاجة لمهارات — البحث العام لا يحتاج إرشادات خاصة +) +``` + +### النمط 3: مهارات + أدوات (خبرة وإجراءات) + +النمط الأكثر شيوعًا في العالم الحقيقي. المهارة توفر *كيف* تقترب من العمل؛ الأدوات توفر *ما* يمكن للوكيل فعله: + +```python +from crewai_tools import SerperDevTool, FileReadTool, CodeInterpreterTool + +analyst = Agent( + role="Security Analyst", + goal="Audit infrastructure for vulnerabilities", + backstory="Expert in cloud security and compliance", + skills=["./skills/security-audit"], # منهجية وقوائم تحقق التدقيق + tools=[ + SerperDevTool(), # البحث عن ثغرات معروفة + FileReadTool(), # قراءة ملفات التكوين + CodeInterpreterTool(), # تشغيل سكربتات التحليل + ], +) +``` + +### النمط 4: مهارات + MCP + +المهارات تعمل مع خوادم MCP بنفس الطريقة التي تعمل بها مع الأدوات: + +```python +agent = Agent( + role="Data Analyst", + goal="Analyze customer data and generate reports", + backstory="Expert data analyst with strong statistical background", + skills=["./skills/data-analysis"], # منهجية التحليل + mcps=["https://data-warehouse.example.com/sse"], # وصول بيانات عن بُعد +) +``` + +### النمط 5: مهارات + تطبيقات + +المهارات يمكن أن توجّه كيف يستخدم الوكيل تكاملات المنصة: + +```python +agent = Agent( + role="Customer Support Agent", + goal="Respond to customer inquiries professionally", + backstory="Experienced support representative", + skills=["./skills/support-playbook"], # قوالب الردود وقواعد التصعيد + apps=["gmail", "zendesk"], # يمكنه إرسال رسائل بريد وتحديث التذاكر +) +``` + +--- + +## المهارات على مستوى الطاقم + +يمكن تعيين المهارات على الطاقم لتُطبّق على **جميع الوكلاء**: + +```python +from crewai import Crew + +crew = Crew( + agents=[researcher, writer, reviewer], + tasks=[research_task, write_task, review_task], + skills=["./skills"], # جميع الوكلاء يحصلون على هذه المهارات +) +``` + +المهارات على مستوى الوكيل لها الأولوية — إذا تم اكتشاف نفس المهارة في كلا المستويين، يتم استخدام نسخة الوكيل. + +--- + +## تنسيق SKILL.md + +```markdown +--- +name: my-skill +description: وصف قصير لما تفعله هذه المهارة ومتى تُستخدم. +license: Apache-2.0 # اختياري +compatibility: crewai>=0.1.0 # اختياري +metadata: # اختياري + author: your-name + version: "1.0" +allowed-tools: web-search file-read # اختياري، تجريبي +--- + +التعليمات للوكيل تُكتب هنا. يتم حقن محتوى Markdown هذا +في إرشادات الوكيل عند تفعيل المهارة. +``` + +### حقول البيانات الوصفية + +| الحقل | مطلوب | الوصف | +| :-------------- | :------- | :----------------------------------------------------------------------- | +| `name` | نعم | 1-64 حرف. أحرف صغيرة أبجدية رقمية وشرطات. يجب أن يطابق اسم المجلد. | +| `description` | نعم | 1-1024 حرف. يصف ما تفعله المهارة ومتى تُستخدم. | +| `license` | لا | اسم الترخيص أو مرجع لملف ترخيص مضمّن. | +| `compatibility` | لا | حد أقصى 500 حرف. متطلبات البيئة (منتجات، حزم، شبكة). | +| `metadata` | لا | تعيين مفتاح-قيمة نصي عشوائي. | +| `allowed-tools` | لا | قائمة أدوات معتمدة مسبقًا مفصولة بمسافات. تجريبي. | + +--- ## هيكل المجلد @@ -21,79 +223,25 @@ my-skill/ └── assets/ # اختياري — ملفات ثابتة (إعدادات، بيانات) ``` -يجب أن يتطابق اسم المجلد مع حقل `name` في `SKILL.md`. +يجب أن يتطابق اسم المجلد مع حقل `name` في `SKILL.md`. مجلدات `scripts/` و `references/` و `assets/` متاحة في مسار المهارة `path` للوكلاء الذين يحتاجون للإشارة إلى الملفات مباشرة. -## تنسيق SKILL.md - -```markdown ---- -name: my-skill -description: Short description of what this skill does and when to use it. -license: Apache-2.0 # optional -compatibility: crewai>=0.1.0 # optional -metadata: # optional - author: your-name - version: "1.0" -allowed-tools: web-search file-read # optional, space-delimited --- -Instructions for the agent go here. This markdown body is injected -into the agent's prompt when the skill is activated. -``` +## المهارات المحمّلة مسبقًا -### حقول البيانات الوصفية - -| الحقل | مطلوب | القيود | -| :-------------- | :------- | :----------------------------------------------------------------------- | -| `name` | نعم | 1-64 حرف. أحرف صغيرة أبجدية رقمية وشرطات. بدون شرطات بادئة/لاحقة/متتالية. يجب أن يطابق اسم المجلد. | -| `description` | نعم | 1-1024 حرف. يصف ما تفعله المهارة ومتى تُستخدم. | -| `license` | لا | اسم الترخيص أو مرجع لملف ترخيص مضمّن. | -| `compatibility` | لا | حد أقصى 500 حرف. متطلبات البيئة (منتجات، حزم، شبكة). | -| `metadata` | لا | تعيين مفتاح-قيمة نصي عشوائي. | -| `allowed-tools` | لا | قائمة أدوات معتمدة مسبقًا مفصولة بمسافات. تجريبي. | - -## الاستخدام - -### المهارات على مستوى الوكيل - -مرر مسارات مجلدات المهارات إلى وكيل: - -```python -from crewai import Agent - -agent = Agent( - role="Researcher", - goal="Find relevant information", - backstory="An expert researcher.", - skills=["./skills"], # يكتشف جميع المهارات في هذا المجلد -) -``` - -### المهارات على مستوى الطاقم - -تُدمج مسارات المهارات في الطاقم مع كل وكيل: - -```python -from crewai import Crew - -crew = Crew( - agents=[agent], - tasks=[task], - skills=["./skills"], -) -``` - -### المهارات المحمّلة مسبقًا - -يمكنك أيضًا تمرير كائنات `Skill` مباشرة: +للمزيد من التحكم، يمكنك اكتشاف المهارات وتفعيلها برمجيًا: ```python from pathlib import Path from crewai.skills import discover_skills, activate_skill +# اكتشاف جميع المهارات في مجلد skills = discover_skills(Path("./skills")) + +# تفعيلها (تحميل محتوى SKILL.md الكامل) activated = [activate_skill(s) for s in skills] +# تمرير إلى وكيل agent = Agent( role="Researcher", goal="Find relevant information", @@ -102,13 +250,57 @@ agent = Agent( ) ``` +--- + ## كيف يتم تحميل المهارات -يتم تحميل المهارات تدريجيًا — فقط البيانات المطلوبة في كل مرحلة يتم قراءتها: +تستخدم المهارات **الكشف التدريجي** — تحمّل فقط ما هو مطلوب في كل مرحلة: -| المرحلة | ما يتم تحميله | متى | -| :--------------- | :------------------------------------------------ | :----------------- | -| الاكتشاف | الاسم، الوصف، حقول البيانات الوصفية | `discover_skills()` | -| التفعيل | نص محتوى SKILL.md الكامل | `activate_skill()` | +| المرحلة | ما يتم تحميله | متى | +| :--------- | :------------------------------------ | :------------------ | +| الاكتشاف | الاسم، الوصف، حقول البيانات الوصفية | `discover_skills()` | +| التفعيل | نص محتوى SKILL.md الكامل | `activate_skill()` | -أثناء التنفيذ العادي للوكيل، يتم اكتشاف المهارات وتفعيلها تلقائيًا. مجلدات `scripts/` و `references/` و `assets/` متاحة في مسار المهارة `path` للوكلاء الذين يحتاجون للإشارة إلى الملفات مباشرة. +أثناء التنفيذ العادي للوكيل (تمرير مسارات المجلدات عبر `skills=["./skills"]`)، يتم اكتشاف المهارات وتفعيلها تلقائيًا. التحميل التدريجي مهم فقط عند استخدام الواجهة البرمجية. + +--- + +## المهارات مقابل المعرفة + +كلا المهارات والمعرفة تُعدّل إرشادات الوكيل، لكنهما يخدمان أغراضًا مختلفة: + +| الجانب | المهارات | المعرفة | +| :--- | :--- | :--- | +| **ما توفره** | تعليمات، إجراءات، إرشادات | حقائق، بيانات، معلومات | +| **كيف تُخزّن** | ملفات Markdown (SKILL.md) | مُضمّنة في مخزن متجهي (ChromaDB) | +| **كيف تُسترجع** | يتم حقن المحتوى الكامل في الإرشادات | البحث الدلالي يجد الأجزاء ذات الصلة | +| **الأفضل لـ** | المنهجيات، قوائم التحقق، أدلة الأسلوب | مستندات الشركة، معلومات المنتج، بيانات مرجعية | +| **يُعيّن عبر** | `skills=["./skills"]` | `knowledge_sources=[source]` | + +**القاعدة العامة:** إذا كان الوكيل يحتاج لاتباع *عملية*، استخدم مهارة. إذا كان يحتاج للرجوع إلى *بيانات*، استخدم المعرفة. + +--- + +## الأسئلة الشائعة + + + + يعتمد على حالة الاستخدام. المهارات والأدوات **مستقلتان** — يمكنك استخدام أيّ منهما أو كليهما أو لا شيء. + + - **مهارات فقط**: عندما يحتاج الوكيل خبرة لكن لا يحتاج إجراءات خارجية (مثال: الكتابة بإرشادات أسلوبية) + - **أدوات فقط**: عندما يحتاج الوكيل إجراءات لكن لا يحتاج منهجية خاصة (مثال: بحث بسيط على الويب) + - **كليهما**: عندما يحتاج الوكيل خبرة وإجراءات (مثال: تدقيق أمني بقوائم تحقق محددة وقدرة على فحص الكود) + + + + **لا.** حقل `allowed-tools` في SKILL.md هو بيانات وصفية تجريبية فقط — لا يُنشئ أو يحقن أي أدوات. يجب عليك دائمًا تعيين الأدوات بشكل منفصل عبر `tools=[]` أو `mcps=[]` أو `apps=[]`. + + + + المهارة على مستوى الوكيل لها الأولوية. يتم إزالة التكرار حسب الاسم — مهارات الوكيل تُعالج أولاً، لذا إذا ظهر نفس اسم المهارة في كلا المستويين، تُستخدم نسخة الوكيل. + + + + هناك تحذير ناعم عند 50,000 حرف، لكن بدون حد صارم. حافظ على تركيز المهارات وإيجازها للحصول على أفضل النتائج — الحقن الكبيرة في الإرشادات قد تُشتت انتباه الوكيل. + + diff --git a/docs/ar/concepts/tools.mdx b/docs/ar/concepts/tools.mdx index 4a0226145..8b1e07aa1 100644 --- a/docs/ar/concepts/tools.mdx +++ b/docs/ar/concepts/tools.mdx @@ -10,6 +10,10 @@ mode: "wide" تُمكّن أدوات CrewAI الوكلاء بقدرات تتراوح من البحث على الويب وتحليل البيانات إلى التعاون وتفويض المهام بين الزملاء. توضح هذه الوثائق كيفية إنشاء هذه الأدوات ودمجها والاستفادة منها ضمن إطار عمل CrewAI، بما في ذلك التركيز على أدوات التعاون. + + الأدوات تمنح الوكلاء **دوال قابلة للاستدعاء** لاتخاذ إجراءات. تعمل جنبًا إلى جنب مع [MCP](/ar/mcp/overview) (خوادم أدوات عن بُعد) و[التطبيقات](/ar/concepts/agent-capabilities) (تكاملات المنصة) و[المهارات](/ar/concepts/skills) (خبرة المجال) و[المعرفة](/ar/concepts/knowledge) (حقائق مُسترجعة). راجع نظرة عامة على [قدرات الوكيل](/ar/concepts/agent-capabilities) لفهم متى تستخدم كل نوع. + + ## ما هي الأداة؟ الأداة في CrewAI هي مهارة أو وظيفة يمكن للوكلاء استخدامها لأداء إجراءات مختلفة. diff --git a/docs/ar/enterprise/features/rbac.mdx b/docs/ar/enterprise/features/rbac.mdx index b7ee2d9eb..166e905cc 100644 --- a/docs/ar/enterprise/features/rbac.mdx +++ b/docs/ar/enterprise/features/rbac.mdx @@ -7,11 +7,13 @@ mode: "wide" ## نظرة عامة -يتيح RBAC في CrewAI AMP إدارة وصول آمنة وقابلة للتوسع من خلال مزيج من الأدوار على مستوى المؤسسة وعناصر التحكم في الرؤية على مستوى الأتمتة. +يتيح RBAC في CrewAI AMP إدارة وصول آمنة وقابلة للتوسع من خلال طبقتين: + +1. **صلاحيات الميزات** — تتحكم في ما يمكن لكل دور القيام به عبر المنصة (إدارة، قراءة، أو بدون وصول) +2. **صلاحيات على مستوى الكيان** — وصول دقيق للأتمتات الفردية ومتغيرات البيئة واتصالات LLM ومستودعات Git نظرة عامة على RBAC في CrewAI AMP - ## المستخدمون والأدوار @@ -39,6 +41,13 @@ mode: "wide" +### الأدوار المحددة مسبقاً + +| الدور | الوصف | +| :---------- | :-------------------------------------------------------------------- | +| **Owner** | وصول كامل لجميع الميزات والإعدادات. لا يمكن تقييده. | +| **Member** | وصول للقراءة لمعظم الميزات، وصول إدارة لمتغيرات البيئة واتصالات LLM ومشاريع Studio. لا يمكنه تعديل إعدادات المؤسسة أو الإعدادات الافتراضية. | + ### ملخص التهيئة | المجال | مكان التهيئة | الخيارات | @@ -46,23 +55,80 @@ mode: "wide" | المستخدمون والأدوار | Settings → Roles | محددة مسبقاً: Owner، Member؛ أدوار مخصصة | | رؤية الأتمتة | Automation → Settings → Visibility | خاص؛ قائمة بيضاء للمستخدمين/الأدوار | -## التحكم في الوصول على مستوى الأتمتة +--- -بالإضافة إلى الأدوار على مستوى المؤسسة، تدعم أتمتات CrewAI إعدادات رؤية دقيقة تتيح لك تقييد الوصول إلى أتمتات محددة حسب المستخدم أو الدور. +## مصفوفة صلاحيات الميزات -هذا مفيد لـ: +لكل دور مستوى صلاحية لكل منطقة ميزة. المستويات الثلاثة هي: + +- **إدارة (Manage)** — وصول كامل للقراءة/الكتابة (إنشاء، تعديل، حذف) +- **قراءة (Read)** — وصول للعرض فقط +- **بدون وصول (No access)** — الميزة مخفية/غير قابلة للوصول + +| الميزة | Owner | Member (افتراضي) | المستويات المتاحة | الوصف | +| :------------------------ | :------ | :--------------- | :--------------------------------- | :-------------------------------------------------------------- | +| `usage_dashboards` | Manage | Read | Manage / Read / No access | عرض مقاييس وتحليلات الاستخدام | +| `crews_dashboards` | Manage | Read | Manage / Read / No access | عرض لوحات النشر والوصول إلى تفاصيل الأتمتة | +| `invitations` | Manage | Read | Manage / Read / No access | دعوة أعضاء جدد إلى المؤسسة | +| `training_ui` | Manage | Read | Manage / Read / No access | الوصول إلى واجهات التدريب/الضبط الدقيق | +| `tools` | Manage | Read | Manage / Read / No access | إنشاء وإدارة الأدوات | +| `agents` | Manage | Read | Manage / Read / No access | إنشاء وإدارة الوكلاء | +| `environment_variables` | Manage | Manage | Manage / No access | إنشاء وإدارة متغيرات البيئة | +| `llm_connections` | Manage | Manage | Manage / No access | تهيئة اتصالات مزودي LLM | +| `default_settings` | Manage | No access | Manage / No access | تعديل الإعدادات الافتراضية على مستوى المؤسسة | +| `organization_settings` | Manage | No access | Manage / No access | إدارة الفوترة والخطط وتهيئة المؤسسة | +| `studio_projects` | Manage | Manage | Manage / No access | إنشاء وتعديل المشاريع في Studio | + + + عند إنشاء دور مخصص، يمكن ضبط معظم الميزات على **Manage** أو **Read** أو **No access**. ومع ذلك، فإن `environment_variables` و`llm_connections` و`default_settings` و`organization_settings` و`studio_projects` تدعم فقط **Manage** أو **No access** — لا يوجد خيار للقراءة فقط لهذه الميزات. + + +--- + +## النشر من GitHub أو Zip + +من أكثر أسئلة RBAC شيوعاً: _"ما الصلاحيات التي يحتاجها عضو الفريق للنشر؟"_ + +### النشر من GitHub + +لنشر أتمتة من مستودع GitHub، يحتاج المستخدم إلى: + +1. **`crews_dashboards`**: على الأقل `Read` — مطلوب للوصول إلى لوحة الأتمتات حيث يتم إنشاء عمليات النشر +2. **الوصول إلى مستودع Git** (إذا كان RBAC على مستوى الكيان لمستودعات Git مفعلاً): يجب منح دور المستخدم الوصول إلى مستودع Git المحدد عبر صلاحيات مستوى الكيان +3. **`studio_projects`: `Manage`** — إذا كان يبني الطاقم في Studio قبل النشر + +### النشر من Zip + +لنشر أتمتة من ملف Zip، يحتاج المستخدم إلى: + +1. **`crews_dashboards`**: على الأقل `Read` — مطلوب للوصول إلى لوحة الأتمتات +2. **تفعيل نشر Zip**: يجب ألا تكون المؤسسة قد عطلت نشر Zip في إعدادات المؤسسة + +### مرجع سريع: الحد الأدنى من الصلاحيات للنشر + +| الإجراء | صلاحيات الميزات المطلوبة | متطلبات إضافية | +| :------------------- | :----------------------------------- | :----------------------------------------------- | +| النشر من GitHub | `crews_dashboards: Read` | وصول كيان مستودع Git (إذا كان Git RBAC مفعلاً) | +| النشر من Zip | `crews_dashboards: Read` | يجب تفعيل نشر Zip على مستوى المؤسسة | +| البناء في Studio | `studio_projects: Manage` | — | +| تهيئة مفاتيح LLM | `llm_connections: Manage` | — | +| ضبط متغيرات البيئة | `environment_variables: Manage` | وصول مستوى الكيان (إذا كان RBAC الكيان مفعلاً) | + +--- + +## التحكم في الوصول على مستوى الأتمتة (صلاحيات الكيان) + +بالإضافة إلى الأدوار على مستوى المؤسسة، يدعم CrewAI صلاحيات دقيقة على مستوى الكيان تقيد الوصول إلى موارد فردية. + +### رؤية الأتمتة + +تدعم الأتمتات إعدادات رؤية تقيد الوصول حسب المستخدم أو الدور. هذا مفيد لـ: - الحفاظ على خصوصية الأتمتات الحساسة أو التجريبية - إدارة الرؤية عبر الفرق الكبيرة أو المتعاونين الخارجيين - اختبار الأتمتات في سياقات معزولة -يمكن تهيئة عمليات النشر كخاصة، مما يعني أن المستخدمين والأدوار المدرجين في القائمة البيضاء فقط سيتمكنون من: - -- عرض عملية النشر -- تشغيلها أو التفاعل مع API الخاص بها -- الوصول إلى سجلاتها ومقاييسها وإعداداتها - -يتمتع مالك المؤسسة دائماً بالوصول، بغض النظر عن إعدادات الرؤية. +يمكن تهيئة عمليات النشر كخاصة، مما يعني أن المستخدمين والأدوار المدرجين في القائمة البيضاء فقط سيتمكنون من التفاعل معها. يمكنك تهيئة التحكم في الوصول على مستوى الأتمتة في Automation → Settings → علامة تبويب Visibility. @@ -99,9 +165,92 @@ mode: "wide" إعدادات رؤية الأتمتة في CrewAI AMP - +### أنواع صلاحيات النشر + +عند منح وصول على مستوى الكيان لأتمتة محددة، يمكنك تعيين أنواع الصلاحيات التالية: + +| الصلاحية | ما تسمح به | +| :------------------- | :-------------------------------------------------- | +| `run` | تنفيذ الأتمتة واستخدام API الخاص بها | +| `traces` | عرض تتبعات التنفيذ والسجلات | +| `manage_settings` | تعديل، إعادة نشر، استرجاع، أو حذف الأتمتة | +| `human_in_the_loop` | الرد على طلبات الإنسان في الحلقة (HITL) | +| `full_access` | جميع ما سبق | + +### RBAC على مستوى الكيان لموارد أخرى + +عند تفعيل RBAC على مستوى الكيان، يمكن أيضاً التحكم في الوصول لهذه الموارد حسب المستخدم أو الدور: + +| المورد | يتم التحكم فيه بواسطة | الوصف | +| :-------------------- | :--------------------------------- | :------------------------------------------------------------- | +| متغيرات البيئة | علامة ميزة RBAC الكيان | تقييد أي الأدوار/المستخدمين يمكنهم عرض أو إدارة متغيرات بيئة محددة | +| اتصالات LLM | علامة ميزة RBAC الكيان | تقييد الوصول لتهيئات مزودي LLM محددة | +| مستودعات Git | إعداد RBAC لمستودعات Git بالمؤسسة | تقييد أي الأدوار/المستخدمين يمكنهم الوصول لمستودعات متصلة محددة | + +--- + +## أنماط الأدوار الشائعة + +بينما يأتي CrewAI بدوري Owner وMember، تستفيد معظم الفرق من إنشاء أدوار مخصصة. إليك الأنماط الشائعة: + +### دور المطور + +دور لأعضاء الفريق الذين يبنون وينشرون الأتمتات لكن لا يديرون إعدادات المؤسسة. + +| الميزة | الصلاحية | +| :------------------------ | :---------- | +| `usage_dashboards` | Read | +| `crews_dashboards` | Manage | +| `invitations` | Read | +| `training_ui` | Read | +| `tools` | Manage | +| `agents` | Manage | +| `environment_variables` | Manage | +| `llm_connections` | Manage | +| `default_settings` | No access | +| `organization_settings` | No access | +| `studio_projects` | Manage | + +### دور المشاهد / أصحاب المصلحة + +دور للمعنيين غير التقنيين الذين يحتاجون لمراقبة الأتمتات وعرض النتائج. + +| الميزة | الصلاحية | +| :------------------------ | :---------- | +| `usage_dashboards` | Read | +| `crews_dashboards` | Read | +| `invitations` | No access | +| `training_ui` | Read | +| `tools` | Read | +| `agents` | Read | +| `environment_variables` | No access | +| `llm_connections` | No access | +| `default_settings` | No access | +| `organization_settings` | No access | +| `studio_projects` | No access | + +### دور مسؤول العمليات / المنصة + +دور لمشغلي المنصة الذين يديرون إعدادات البنية التحتية لكن قد لا يبنون الوكلاء. + +| الميزة | الصلاحية | +| :------------------------ | :---------- | +| `usage_dashboards` | Manage | +| `crews_dashboards` | Manage | +| `invitations` | Manage | +| `training_ui` | Read | +| `tools` | Read | +| `agents` | Read | +| `environment_variables` | Manage | +| `llm_connections` | Manage | +| `default_settings` | Manage | +| `organization_settings` | Read | +| `studio_projects` | No access | + +--- + تواصل مع فريق الدعم للمساعدة في أسئلة RBAC. diff --git a/docs/ar/enterprise/guides/deploy-to-amp.mdx b/docs/ar/enterprise/guides/deploy-to-amp.mdx index a7d7a137b..befc894d7 100644 --- a/docs/ar/enterprise/guides/deploy-to-amp.mdx +++ b/docs/ar/enterprise/guides/deploy-to-amp.mdx @@ -106,7 +106,7 @@ mode: "wide" ``` - يستغرق النشر الأول عادة 10-15 دقيقة لبناء صور الحاويات. عمليات النشر اللاحقة أسرع بكثير. + يستغرق النشر الأول عادة حوالي دقيقة واحدة. @@ -188,7 +188,7 @@ crewai deploy remove 1. انقر على زر "Deploy" لبدء عملية النشر 2. يمكنك مراقبة التقدم عبر شريط التقدم - 3. يستغرق النشر الأول عادة حوالي 10-15 دقيقة؛ عمليات النشر اللاحقة ستكون أسرع + 3. يستغرق النشر الأول عادة حوالي دقيقة واحدة ![تقدم النشر](/images/enterprise/deploy-progress.png) diff --git a/docs/ar/enterprise/guides/training-crews.mdx b/docs/ar/enterprise/guides/training-crews.mdx new file mode 100644 index 000000000..77f9bb7bf --- /dev/null +++ b/docs/ar/enterprise/guides/training-crews.mdx @@ -0,0 +1,132 @@ +--- +title: "تدريب الطواقم" +description: "قم بتدريب طواقمك المنشورة مباشرة من منصة CrewAI AMP لتحسين أداء الوكلاء بمرور الوقت" +icon: "dumbbell" +mode: "wide" +--- + +يتيح لك التدريب تحسين أداء الطاقم من خلال تشغيل جلسات تدريب تكرارية مباشرة من علامة تبويب **Training** في CrewAI AMP. تستخدم المنصة **وضع التدريب التلقائي** — حيث تتولى العملية التكرارية تلقائياً، على عكس تدريب CLI الذي يتطلب ملاحظات بشرية تفاعلية لكل تكرار. + +بعد اكتمال التدريب، يقوم CrewAI بتقييم مخرجات الوكلاء ودمج الملاحظات في اقتراحات قابلة للتنفيذ لكل وكيل. يتم بعد ذلك تطبيق هذه الاقتراحات على تشغيلات الطاقم المستقبلية لتحسين جودة المخرجات. + + + للحصول على تفاصيل حول كيفية عمل تدريب CrewAI، راجع صفحة [مفاهيم التدريب](/ar/concepts/training). + + +## المتطلبات الأساسية + + + + تحتاج إلى حساب CrewAI AMP مع نشر نشط في حالة **Ready** (نوع Crew). + + + يجب أن يكون لحسابك صلاحية تشغيل للنشر الذي تريد تدريبه. + + + +## كيفية تدريب طاقم + + + + انتقل إلى **Deployments**، انقر على نشرك، ثم اختر علامة تبويب **Training**. + + + + قدم **Training Name** — سيصبح هذا اسم ملف `.pkl` المستخدم لتخزين نتائج التدريب. على سبيل المثال، "Expert Mode Training" ينتج `expert_mode_training.pkl`. + + + + أدخل حقول إدخال الطاقم. هذه هي نفس المدخلات التي ستقدمها للتشغيل العادي — يتم تحميلها ديناميكياً بناءً على تكوين طاقمك. + + + + انقر على **Train Crew**. يتغير الزر إلى "Training..." مع مؤشر دوران أثناء تشغيل العملية. + + خلف الكواليس: + - يتم إنشاء سجل تدريب للنشر الخاص بك + - تستدعي المنصة نقطة نهاية التدريب التلقائي للنشر + - يقوم الطاقم بتشغيل تكراراته تلقائياً — لا حاجة لملاحظات يدوية + + + + تعرض لوحة **Current Training Status**: + - **Status** — الحالة الحالية لجلسة التدريب + - **Nº Iterations** — عدد تكرارات التدريب المُهيأة + - **Filename** — ملف `.pkl` الذي يتم إنشاؤه + - **Started At** — وقت بدء التدريب + - **Training Inputs** — المدخلات التي قدمتها + + + +## فهم نتائج التدريب + +بمجرد اكتمال التدريب، سترى بطاقات نتائج لكل وكيل تحتوي على المعلومات التالية: + +- **Agent Role** — اسم/دور الوكيل في طاقمك +- **Final Quality** — درجة من 0 إلى 10 تقيّم جودة مخرجات الوكيل +- **Final Summary** — ملخص لأداء الوكيل أثناء التدريب +- **Suggestions** — توصيات قابلة للتنفيذ لتحسين سلوك الوكيل + +### تحرير الاقتراحات + +يمكنك تحسين الاقتراحات لأي وكيل: + + + + في بطاقة نتائج أي وكيل، انقر على زر **Edit** بجوار الاقتراحات. + + + + حدّث نص الاقتراحات ليعكس التحسينات التي تريدها بشكل أفضل. + + + + انقر على **Save**. تتم مزامنة الاقتراحات المُعدّلة مع النشر وتُستخدم في جميع التشغيلات المستقبلية. + + + +## استخدام بيانات التدريب + +لتطبيق نتائج التدريب على طاقمك: + +1. لاحظ **Training Filename** (ملف `.pkl`) من جلسة التدريب المكتملة. +2. حدد اسم الملف هذا في تكوين kickoff أو التشغيل الخاص بنشرك. +3. يقوم الطاقم تلقائياً بتحميل ملف التدريب وتطبيق الاقتراحات المخزنة على كل وكيل. + +هذا يعني أن الوكلاء يستفيدون من الملاحظات المُنشأة أثناء التدريب في كل تشغيل لاحق. + +## التدريبات السابقة + +يعرض الجزء السفلي من علامة تبويب Training **سجل جميع جلسات التدريب السابقة** للنشر. استخدم هذا لمراجعة التدريبات السابقة، ومقارنة النتائج، أو اختيار ملف تدريب مختلف للاستخدام. + +## معالجة الأخطاء + +إذا فشل تشغيل التدريب، تعرض لوحة الحالة حالة خطأ مع رسالة تصف ما حدث خطأ. + +الأسباب الشائعة لفشل التدريب: +- **لم يتم تحديث وقت تشغيل النشر** — تأكد من أن نشرك يعمل بأحدث إصدار +- **أخطاء تنفيذ الطاقم** — مشاكل في منطق مهام الطاقم أو تكوين الوكيل +- **مشاكل الشبكة** — مشاكل الاتصال بين المنصة والنشر + +## القيود + + + ضع هذه القيود في الاعتبار عند التخطيط لسير عمل التدريب الخاص بك: + - **تدريب نشط واحد في كل مرة** لكل نشر — انتظر حتى ينتهي التشغيل الحالي قبل بدء آخر + - **وضع التدريب التلقائي فقط** — لا تدعم المنصة الملاحظات التفاعلية لكل تكرار مثل CLI + - **بيانات التدريب خاصة بالنشر** — ترتبط نتائج التدريب بمثيل وإصدار النشر المحدد + + +## الموارد ذات الصلة + + + + تعلم كيف يعمل تدريب CrewAI. + + + قم بتشغيل طاقمك المنشور من منصة AMP. + + + انشر طاقمك واجعله جاهزاً للتدريب. + + diff --git a/docs/ar/installation.mdx b/docs/ar/installation.mdx index cfff6080d..3a902fae0 100644 --- a/docs/ar/installation.mdx +++ b/docs/ar/installation.mdx @@ -5,6 +5,14 @@ icon: wrench mode: "wide" --- +### شاهد: بناء Agents و Flows في CrewAI باستخدام Coding Agent Skills + +قم بتثبيت مهارات وكيل البرمجة الخاصة بنا (Claude Code، Codex، ...) لتشغيل وكلاء البرمجة بسرعة مع CrewAI. + +يمكنك تثبيتها باستخدام `npx skills add crewaiinc/skills` + + + ## فيديو تعليمي شاهد هذا الفيديو التعليمي لعرض تفصيلي لعملية التثبيت: @@ -196,8 +204,8 @@ python3 --version ## الخطوات التالية - - اتبع دليل البداية السريعة لإنشاء أول Agent في CrewAI والحصول على تجربة عملية. + + اتبع البداية السريعة لإنشاء Flow وتشغيل طاقم بوكيل واحد وإنتاج تقرير. + ## بنية CrewAI المعمارية صُممت بنية CrewAI لتحقيق التوازن بين الاستقلالية والتحكم. @@ -130,9 +138,9 @@ mode: "wide" - اتبع دليل البداية السريعة لإنشاء أول Agent في CrewAI والحصول على تجربة عملية. + أنشئ Flow وشغّل طاقمًا بوكيل واحد وأنشئ تقريرًا من البداية للنهاية. + +في هذا الدليل ستُنشئ **Flow** يحدد موضوع بحث، ويشغّل **طاقمًا بوكيل واحد** (باحث يستخدم البحث على الويب)، وينتهي بتقرير **Markdown** على القرص. يُعد Flow الطريقة الموصى بها لتنظيم التطبيقات الإنتاجية: يمتلك **الحالة** و**ترتيب التنفيذ**، بينما **الوكلاء** ينفّذون العمل داخل خطوة الطاقم. + +إذا لم تُكمل تثبيت CrewAI بعد، اتبع [دليل التثبيت](/ar/installation) أولًا. + +## المتطلبات الأساسية + +- بيئة Python وواجهة سطر أوامر CrewAI (راجع [التثبيت](/ar/installation)) +- نموذج لغوي مهيأ بالمفاتيح الصحيحة — راجع [LLMs](/ar/concepts/llms#setting-up-your-llm) +- مفتاح API من [Serper.dev](https://serper.dev/) (`SERPER_API_KEY`) للبحث على الويب في هذا الدرس + +## ابنِ أول Flow لك - - أنشئ مشروع طاقم جديد عبر تشغيل الأمر التالي في الطرفية. - سينشئ هذا مجلداً جديداً باسم `latest-ai-development` مع البنية الأساسية لطاقمك. + + من الطرفية، أنشئ مشروع Flow (اسم المجلد يستخدم شرطة سفلية، مثل `latest_ai_flow`): + ```shell Terminal - crewai create crew latest-ai-development + crewai create flow latest-ai-flow + cd latest_ai_flow ``` + + يُنشئ ذلك تطبيق Flow ضمن `src/latest_ai_flow/`، بما في ذلك طاقمًا أوليًا في `crews/content_crew/` ستستبدله بطاقم بحث **بوكيل واحد** في الخطوات التالية. - - - ```shell Terminal - cd latest_ai_development - ``` - - - - - يمكنك أيضاً تعديل الوكلاء حسب الحاجة ليناسبوا حالة الاستخدام الخاصة بك أو نسخ ولصق كما هو في مشروعك. - أي متغير مُستكمل في ملفات `agents.yaml` و`tasks.yaml` مثل `{topic}` سيُستبدل بقيمة المتغير في ملف `main.py`. - + + + استبدل محتوى `src/latest_ai_flow/crews/content_crew/config/agents.yaml` بباحث واحد. تُملأ المتغيرات مثل `{topic}` من `crew.kickoff(inputs=...)`. + ```yaml agents.yaml - # src/latest_ai_development/config/agents.yaml + # src/latest_ai_flow/crews/content_crew/config/agents.yaml researcher: role: > - {topic} Senior Data Researcher + باحث بيانات أول في {topic} goal: > - Uncover cutting-edge developments in {topic} + اكتشاف أحدث التطورات في {topic} backstory: > - You're a seasoned researcher with a knack for uncovering the latest - developments in {topic}. Known for your ability to find the most relevant - information and present it in a clear and concise manner. - - reporting_analyst: - role: > - {topic} Reporting Analyst - goal: > - Create detailed reports based on {topic} data analysis and research findings - backstory: > - You're a meticulous analyst with a keen eye for detail. You're known for - your ability to turn complex data into clear and concise reports, making - it easy for others to understand and act on the information you provide. + أنت باحث مخضرم تكشف أحدث المستجدات في {topic}. + تجد المعلومات الأكثر صلة وتعرضها بوضوح. ``` - + + ```yaml tasks.yaml - # src/latest_ai_development/config/tasks.yaml + # src/latest_ai_flow/crews/content_crew/config/tasks.yaml research_task: description: > - Conduct a thorough research about {topic} - Make sure you find any interesting and relevant information given - the current year is 2025. + أجرِ بحثًا معمقًا عن {topic}. استخدم البحث على الويب للعثور على معلومات + حديثة وموثوقة. السنة الحالية 2026. expected_output: > - A list with 10 bullet points of the most relevant information about {topic} + تقرير بصيغة Markdown بأقسام واضحة: الاتجاهات الرئيسية، أدوات أو شركات بارزة، + والآثار. بين 800 و1200 كلمة تقريبًا. دون إحاطة المستند بأكمله بكتل كود. agent: researcher - - reporting_task: - description: > - Review the context you got and expand each topic into a full section for a report. - Make sure the report is detailed and contains any and all relevant information. - expected_output: > - A fully fledge reports with the mains topics, each with a full section of information. - Formatted as markdown without '```' - agent: reporting_analyst - output_file: report.md + output_file: output/report.md ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task - from crewai_tools import SerperDevTool - from crewai.agents.agent_builder.base_agent import BaseAgent + + + اجعل الطاقم المُولَّد يشير إلى YAML وأرفق `SerperDevTool` بالباحث. + + ```python content_crew.py + # src/latest_ai_flow/crews/content_crew/content_crew.py from typing import List + from crewai import Agent, Crew, Process, Task + from crewai.agents.agent_builder.base_agent import BaseAgent + from crewai.project import CrewBase, agent, crew, task + from crewai_tools import SerperDevTool + + @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + class ResearchCrew: + """طاقم بحث بوكيل واحد داخل Flow.""" agents: List[BaseAgent] tasks: List[Task] + agents_config = "config/agents.yaml" + tasks_config = "config/tasks.yaml" + @agent def researcher(self) -> Agent: return Agent( - config=self.agents_config['researcher'], # type: ignore[index] + config=self.agents_config["researcher"], # type: ignore[index] verbose=True, - tools=[SerperDevTool()] - ) - - @agent - def reporting_analyst(self) -> Agent: - return Agent( - config=self.agents_config['reporting_analyst'], # type: ignore[index] - verbose=True + tools=[SerperDevTool()], ) @task def research_task(self) -> Task: return Task( - config=self.tasks_config['research_task'], # type: ignore[index] - ) - - @task - def reporting_task(self) -> Task: - return Task( - config=self.tasks_config['reporting_task'], # type: ignore[index] - output_file='output/report.md' # This is the file that will be contain the final report. + config=self.tasks_config["research_task"], # type: ignore[index] ) @crew def crew(self) -> Crew: - """Creates the LatestAiDevelopment crew""" return Crew( - agents=self.agents, # Automatically created by the @agent decorator - tasks=self.tasks, # Automatically created by the @task decorator + agents=self.agents, + tasks=self.tasks, process=Process.sequential, verbose=True, ) ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task, before_kickoff, after_kickoff - from crewai_tools import SerperDevTool - @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + + اربط الطاقم بـ Flow: خطوة `@start()` تضبط الموضوع في **الحالة**، وخطوة `@listen` تشغّل الطاقم. يظل `output_file` للمهمة يكتب `output/report.md`. - @before_kickoff - def before_kickoff_function(self, inputs): - print(f"Before kickoff function with inputs: {inputs}") - return inputs # You can return the inputs or modify them as needed - - @after_kickoff - def after_kickoff_function(self, result): - print(f"After kickoff function with result: {result}") - return result # You can return the result or modify it as needed - - # ... remaining code - ``` - - - - على سبيل المثال، يمكنك تمرير مدخل `topic` لطاقمك لتخصيص البحث وإعداد التقارير. ```python main.py - #!/usr/bin/env python - # src/latest_ai_development/main.py - import sys - from latest_ai_development.crew import LatestAiDevelopmentCrew + # src/latest_ai_flow/main.py + from pydantic import BaseModel - def run(): - """ - Run the crew. - """ - inputs = { - 'topic': 'AI Agents' - } - LatestAiDevelopmentCrew().crew().kickoff(inputs=inputs) + from crewai.flow import Flow, listen, start + + from latest_ai_flow.crews.content_crew.content_crew import ResearchCrew + + + class ResearchFlowState(BaseModel): + topic: str = "" + report: str = "" + + + class LatestAiFlow(Flow[ResearchFlowState]): + @start() + def prepare_topic(self, crewai_trigger_payload: dict | None = None): + if crewai_trigger_payload: + self.state.topic = crewai_trigger_payload.get("topic", "AI Agents") + else: + self.state.topic = "AI Agents" + print(f"الموضوع: {self.state.topic}") + + @listen(prepare_topic) + def run_research(self): + result = ResearchCrew().crew().kickoff(inputs={"topic": self.state.topic}) + self.state.report = result.raw + print("اكتمل طاقم البحث.") + + @listen(run_research) + def summarize(self): + print("مسار التقرير: output/report.md") + + + def kickoff(): + LatestAiFlow().kickoff() + + + def plot(): + LatestAiFlow().plot() + + + if __name__ == "__main__": + kickoff() ``` - - - قبل تشغيل طاقمك، تأكد من تعيين المفاتيح التالية كمتغيرات بيئة في ملف `.env`: - - مفتاح API لـ [Serper.dev](https://serper.dev/): `SERPER_API_KEY=YOUR_KEY_HERE` - - إعداد النموذج الذي اخترته، مثل مفتاح API. راجع - [دليل إعداد LLM](/ar/concepts/llms#setting-up-your-llm) لمعرفة كيفية إعداد النماذج من أي مزود. - - - - اقفل التبعيات وثبّتها باستخدام أمر CLI: - - ```shell Terminal - crewai install - ``` - - - إذا كانت لديك حزم إضافية تريد تثبيتها، يمكنك القيام بذلك عبر: - - ```shell Terminal - uv add - ``` - - - - - لتشغيل طاقمك، نفّذ الأمر التالي في جذر مشروعك: - - ```bash Terminal - crewai run - ``` - + + إذا كان اسم الحزمة ليس `latest_ai_flow`، عدّل استيراد `ResearchCrew` ليطابق مسار الوحدة في مشروعك. + - - لمستخدمي CrewAI AMP، يمكنك إنشاء نفس الطاقم دون كتابة كود: + + في جذر المشروع، ضبط `.env`: -1. سجّل الدخول إلى حساب CrewAI AMP (أنشئ حساباً مجانياً على [app.crewai.com](https://app.crewai.com)) -2. افتح Crew Studio -3. اكتب ما هي الأتمتة التي تحاول بناءها -4. أنشئ مهامك بصرياً واربطها بالتسلسل -5. هيئ مدخلاتك وانقر "تحميل الكود" أو "نشر" - -![واجهة Crew Studio للبدء السريع](/images/enterprise/crew-studio-interface.png) - - - ابدأ حسابك المجاني في CrewAI AMP - + - `SERPER_API_KEY` — من [Serper.dev](https://serper.dev/) + - مفاتيح مزوّد النموذج حسب الحاجة — راجع [إعداد LLM](/ar/concepts/llms#setting-up-your-llm) - - يجب أن ترى المخرجات في وحدة التحكم ويجب إنشاء ملف `report.md` في جذر مشروعك مع التقرير النهائي. -إليك مثالاً على شكل التقرير: + + + ```shell Terminal + crewai install + crewai run + ``` + + + يُنفّذ `crewai run` نقطة دخول Flow المعرّفة في المشروع (نفس أمر الطواقم؛ نوع المشروع `"flow"` في `pyproject.toml`). + + + + يجب أن ترى سجلات من Flow والطاقم. افتح **`output/report.md`** للتقرير المُولَّد (مقتطف): ```markdown output/report.md - # Comprehensive Report on the Rise and Impact of AI Agents in 2025 + # وكلاء الذكاء الاصطناعي في 2026: المشهد والاتجاهات - ## 1. Introduction to AI Agents - In 2025, Artificial Intelligence (AI) agents are at the forefront of innovation across various industries. As intelligent systems that can perform tasks typically requiring human cognition, AI agents are paving the way for significant advancements in operational efficiency, decision-making, and overall productivity within sectors like Human Resources (HR) and Finance. This report aims to detail the rise of AI agents, their frameworks, applications, and potential implications on the workforce. + ## ملخص تنفيذي + … - ## 2. Benefits of AI Agents - AI agents bring numerous advantages that are transforming traditional work environments. Key benefits include: + ## أبرز الاتجاهات + - **استخدام الأدوات والتنسيق** — … + - **التبني المؤسسي** — … - - **Task Automation**: AI agents can carry out repetitive tasks such as data entry, scheduling, and payroll processing without human intervention, greatly reducing the time and resources spent on these activities. - - **Improved Efficiency**: By quickly processing large datasets and performing analyses that would take humans significantly longer, AI agents enhance operational efficiency. This allows teams to focus on strategic tasks that require higher-level thinking. - - **Enhanced Decision-Making**: AI agents can analyze trends and patterns in data, provide insights, and even suggest actions, helping stakeholders make informed decisions based on factual data rather than intuition alone. - - ## 3. Popular AI Agent Frameworks - Several frameworks have emerged to facilitate the development of AI agents, each with its own unique features and capabilities. Some of the most popular frameworks include: - - - **Autogen**: A framework designed to streamline the development of AI agents through automation of code generation. - - **Semantic Kernel**: Focuses on natural language processing and understanding, enabling agents to comprehend user intentions better. - - **Promptflow**: Provides tools for developers to create conversational agents that can navigate complex interactions seamlessly. - - **Langchain**: Specializes in leveraging various APIs to ensure agents can access and utilize external data effectively. - - **CrewAI**: Aimed at collaborative environments, CrewAI strengthens teamwork by facilitating communication through AI-driven insights. - - **MemGPT**: Combines memory-optimized architectures with generative capabilities, allowing for more personalized interactions with users. - - These frameworks empower developers to build versatile and intelligent agents that can engage users, perform advanced analytics, and execute various tasks aligned with organizational goals. - - ## 4. AI Agents in Human Resources - AI agents are revolutionizing HR practices by automating and optimizing key functions: - - - **Recruiting**: AI agents can screen resumes, schedule interviews, and even conduct initial assessments, thus accelerating the hiring process while minimizing biases. - - **Succession Planning**: AI systems analyze employee performance data and potential, helping organizations identify future leaders and plan appropriate training. - - **Employee Engagement**: Chatbots powered by AI can facilitate feedback loops between employees and management, promoting an open culture and addressing concerns promptly. - - As AI continues to evolve, HR departments leveraging these agents can realize substantial improvements in both efficiency and employee satisfaction. - - ## 5. AI Agents in Finance - The finance sector is seeing extensive integration of AI agents that enhance financial practices: - - - **Expense Tracking**: Automated systems manage and monitor expenses, flagging anomalies and offering recommendations based on spending patterns. - - **Risk Assessment**: AI models assess credit risk and uncover potential fraud by analyzing transaction data and behavioral patterns. - - **Investment Decisions**: AI agents provide stock predictions and analytics based on historical data and current market conditions, empowering investors with informative insights. - - The incorporation of AI agents into finance is fostering a more responsive and risk-aware financial landscape. - - ## 6. Market Trends and Investments - The growth of AI agents has attracted significant investment, especially amidst the rising popularity of chatbots and generative AI technologies. Companies and entrepreneurs are eager to explore the potential of these systems, recognizing their ability to streamline operations and improve customer engagement. - - Conversely, corporations like Microsoft are taking strides to integrate AI agents into their product offerings, with enhancements to their Copilot 365 applications. This strategic move emphasizes the importance of AI literacy in the modern workplace and indicates the stabilizing of AI agents as essential business tools. - - ## 7. Future Predictions and Implications - Experts predict that AI agents will transform essential aspects of work life. As we look toward the future, several anticipated changes include: - - - Enhanced integration of AI agents across all business functions, creating interconnected systems that leverage data from various departmental silos for comprehensive decision-making. - - Continued advancement of AI technologies, resulting in smarter, more adaptable agents capable of learning and evolving from user interactions. - - Increased regulatory scrutiny to ensure ethical use, especially concerning data privacy and employee surveillance as AI agents become more prevalent. - - To stay competitive and harness the full potential of AI agents, organizations must remain vigilant about latest developments in AI technology and consider continuous learning and adaptation in their strategic planning. - - ## 8. Conclusion - The emergence of AI agents is undeniably reshaping the workplace landscape in 5. With their ability to automate tasks, enhance efficiency, and improve decision-making, AI agents are critical in driving operational success. Organizations must embrace and adapt to AI developments to thrive in an increasingly digital business environment. + ## الآثار + … ``` - + + سيكون الملف الفعلي أطول ويعكس نتائج بحث مباشرة. +## كيف يترابط هذا + +1. **Flow** — يشغّل `LatestAiFlow` أولًا `prepare_topic` ثم `run_research` ثم `summarize`. الحالة (`topic`، `report`) على Flow. +2. **الطاقم** — يشغّل `ResearchCrew` مهمة واحدة بوكيل واحد: الباحث يستخدم **Serper** للبحث على الويب ثم يكتب التقرير. +3. **المُخرَج** — يكتب `output_file` للمهمة التقرير في `output/report.md`. + +للتعمق في أنماط Flow (التوجيه، الاستمرارية، الإنسان في الحلقة)، راجع [ابنِ أول Flow](/ar/guides/flows/first-flow) و[Flows](/ar/concepts/flows). للطواقم دون Flow، راجع [Crews](/ar/concepts/crews). لوكيل `Agent` واحد و`kickoff()` بلا مهام، راجع [Agents](/ar/concepts/agents#direct-agent-interaction-with-kickoff). + -تهانينا! - -لقد أعددت مشروع طاقمك بنجاح وأنت جاهز للبدء في بناء سير العمل الوكيلي الخاص بك! - +أصبح لديك Flow كامل مع طاقم وكيل وتقرير محفوظ — قاعدة قوية لإضافة خطوات أو طواقم أو أدوات. -### ملاحظة حول اتساق التسمية +### اتساق التسمية -يجب أن تتطابق الأسماء التي تستخدمها في ملفات YAML (`agents.yaml` و`tasks.yaml`) مع أسماء الدوال في كود Python الخاص بك. -على سبيل المثال، يمكنك الإشارة إلى الوكيل لمهام محددة من ملف `tasks.yaml`. -يتيح اتساق التسمية هذا لـ CrewAI ربط تكويناتك بكودك تلقائياً؛ وإلا فلن تتعرف مهمتك على المرجع بشكل صحيح. +يجب أن تطابق مفاتيح YAML (`researcher`، `research_task`) أسماء الدوال في صف `@CrewBase`. راجع [Crews](/ar/concepts/crews) لنمط الديكورات الكامل. -#### أمثلة على المراجع +## النشر - - لاحظ كيف نستخدم نفس الاسم للوكيل في ملف `agents.yaml` - (`email_summarizer`) واسم الدالة في ملف `crew.py` - (`email_summarizer`). - +ادفع Flow إلى **[CrewAI AMP](https://app.crewai.com)** بعد أن يعمل محليًا ويكون المشروع في مستودع **GitHub**. من جذر المشروع: -```yaml agents.yaml -email_summarizer: - role: > - Email Summarizer - goal: > - Summarize emails into a concise and clear summary - backstory: > - You will create a 5 bullet point summary of the report - llm: provider/model-id # Add your choice of model here + +```bash المصادقة +crewai login ``` - - لاحظ كيف نستخدم نفس الاسم للمهمة في ملف `tasks.yaml` - (`email_summarizer_task`) واسم الدالة في ملف `crew.py` - (`email_summarizer_task`). - - -```yaml tasks.yaml -email_summarizer_task: - description: > - Summarize the email into a 5 bullet point summary - expected_output: > - A 5 bullet point summary of the email - agent: email_summarizer - context: - - reporting_task - - research_task +```bash إنشاء نشر +crewai deploy create ``` -## نشر طاقمك +```bash الحالة والسجلات +crewai deploy status +crewai deploy logs +``` -أسهل طريقة لنشر طاقمك في الإنتاج هي من خلال [CrewAI AMP](http://app.crewai.com). +```bash إرسال التحديثات بعد تغيير الكود +crewai deploy push +``` -شاهد هذا الفيديو التعليمي لعرض خطوة بخطوة لنشر طاقمك على [CrewAI AMP](http://app.crewai.com) باستخدام CLI. +```bash عرض النشرات أو حذفها +crewai deploy list +crewai deploy remove +``` + - + + غالبًا ما يستغرق **النشر الأول حوالي دقيقة**. المتطلبات الكاملة ومسار الواجهة الويب في [النشر على AMP](/ar/enterprise/guides/deploy-to-amp). + - - ابدأ مع CrewAI AMP وانشر طاقمك في بيئة إنتاج - بنقرات قليلة فقط. + + النشر على AMP خطوة بخطوة (CLI ولوحة التحكم). - انضم إلى مجتمعنا مفتوح المصدر لمناقشة الأفكار ومشاركة مشاريعك والتواصل - مع مطورين آخرين لـ CrewAI. + ناقش الأفكار وشارك مشاريعك وتواصل مع مطوري CrewAI. diff --git a/docs/ar/skills.mdx b/docs/ar/skills.mdx new file mode 100644 index 000000000..4e0bf6e22 --- /dev/null +++ b/docs/ar/skills.mdx @@ -0,0 +1,50 @@ +--- +title: Skills +description: ثبّت crewaiinc/skills من السجل الرسمي على skills.sh—Flows وCrews ووكلاء مرتبطون بالوثائق لـ Claude Code وCursor وCodex وغيرها. +icon: wand-magic-sparkles +mode: "wide" +--- + +# Skills + +**امنح وكيل البرمجة سياق CrewAI في أمر واحد.** + +تُنشر **Skills** الخاصة بـ CrewAI على **[skills.sh/crewaiinc/skills](https://skills.sh/crewaiinc/skills)**—السجل الرسمي لـ `crewaiinc/skills`، بما في ذلك كل مهارة (مثل **design-agent** و**getting-started** و**design-task** و**ask-docs**) وإحصاءات التثبيت والتدقيقات. تعلّم وكلاء البرمجة—مثل Claude Code وCursor وCodex—هيكلة Flows وضبط Crews واستخدام الأدوات واتباع أنماط CrewAI. نفّذ الأمر أدناه (أو الصقه في الوكيل). + +```shell Terminal +npx skills add crewaiinc/skills +``` + +يضيف ذلك حزمة المهارات إلى سير عمل الوكيل لتطبيق اتفاقيات CrewAI دون إعادة شرح الإطار في كل جلسة. المصدر والقضايا على [GitHub](https://github.com/crewAIInc/skills). + +## ما يحصل عليه الوكيل + +- **Flows** — تطبيقات ذات حالة وخطوات وkickoffs للـ crew على نمط CrewAI +- **Crews والوكلاء** — أنماط YAML أولاً، أدوار، مهام، وتفويض +- **الأدوات والتكاملات** — ربط الوكلاء بالبحث وواجهات API وأدوات CrewAI الشائعة +- **هيكل المشروع** — مواءمة مع قوالب CLI واتفاقيات المستودع +- **أنماط محدثة** — تتبع المهارات وثائق CrewAI والممارسات الموصى بها + +## تعرّف أكثر على هذا الموقع + + + + استخدام `AGENTS.md` وسير عمل وكلاء البرمجة مع CrewAI. + + + ابنِ أول Flow وcrew من البداية للنهاية. + + + ثبّت CrewAI CLI وحزمة Python. + + + القائمة الرسمية لـ `crewaiinc/skills`—المهارات والتثبيتات والتدقيقات. + + + مصدر الحزمة والتحديثات والقضايا. + + + +### فيديو: CrewAI مع مهارات وكلاء البرمجة + + + ## Video Tutorial Watch this video tutorial for a step-by-step demonstration of the installation process: @@ -163,6 +171,9 @@ We recommend using the `YAML` template scaffolding for a structured approach to ```shell uv add ``` + + As a supply-chain security measure, CrewAI's internal packages use `exclude-newer = "3 days"` in their `pyproject.toml` files. This means transitive dependencies pulled in by CrewAI won't resolve packages released less than 3 days ago. Your own direct dependencies are not affected by this policy. If you notice a transitive dependency is behind, you can pin the version you want explicitly in your project's dependencies. + - To run your crew, execute the following command in the root of your project: ```bash crewai run @@ -196,9 +207,8 @@ For teams and organizations, CrewAI offers enterprise deployment options that el ## Next Steps - - Follow our quickstart guide to create your first CrewAI agent and get - hands-on experience. + + Follow the quickstart to scaffold a Flow, run a one-agent crew, and produce a report. + ## The CrewAI Architecture CrewAI's architecture is designed to balance autonomy with control. @@ -132,7 +140,7 @@ For any production-ready application, **start with a Flow**. icon="bolt" href="en/quickstart" > - Follow our quickstart guide to create your first CrewAI agent and get hands-on experience. + Scaffold a Flow, run a crew with one agent, and generate a report end to end. + Deploying A2A agents to production? See [A2A on AMP](/en/enterprise/features/a2a) for distributed state, enterprise authentication, gRPC transport, and horizontal scaling. + + CrewAI treats [A2A protocol](https://a2a-protocol.org/latest/) as a first-class delegation primitive, enabling agents to delegate tasks, request information, and collaborate with remote agents, as well as act as A2A-compliant server agents. In client mode, agents autonomously choose between local execution and remote delegation based on task requirements. @@ -96,24 +100,28 @@ The `A2AClientConfig` class accepts the following parameters: Update mechanism for receiving task status. Options: `StreamingConfig`, `PollingConfig`, or `PushNotificationConfig`. - - Transport protocol for A2A communication. Options: `JSONRPC` (default), `GRPC`, or `HTTP+JSON`. - - Media types the client can accept in responses. - - Ordered list of transport protocols the client supports. - - - - Whether to prioritize client transport preferences over server. - - - Extension URIs the client supports. + A2A protocol extension URIs the client supports. + + + + Client-side processing hooks for tool injection, prompt augmentation, and response modification. + + + + Transport configuration including preferred transport, supported transports for negotiation, and protocol-specific settings (gRPC message sizes, keepalive, etc.). + + + + **Deprecated**: Use `transport=ClientTransportConfig(preferred=...)` instead. + + + + **Deprecated**: Use `transport=ClientTransportConfig(supported=...)` instead. ## Authentication @@ -405,11 +413,7 @@ agent = Agent( Preferred endpoint URL. If set, overrides the URL passed to `to_agent_card()`. - - Transport protocol for the preferred endpoint. - - - + A2A protocol version this agent supports. @@ -441,8 +445,36 @@ agent = Agent( Whether agent provides extended card to authenticated users. - - JSON Web Signatures for the AgentCard. + + Additional skills visible only to authenticated users in the extended agent card. + + + + Configuration for signing the AgentCard with JWS. Supports RS256, ES256, PS256, and related algorithms. + + + + Server-side A2A protocol extensions with `on_request`/`on_response` hooks that modify agent behavior. + + + + Configuration for outgoing push notifications, including HMAC-SHA256 signing secret. + + + + Transport configuration including preferred transport, gRPC server settings, JSON-RPC paths, and HTTP+JSON settings. + + + + Authentication scheme for incoming A2A requests. Defaults to `SimpleTokenAuth` using the `AUTH_TOKEN` environment variable. + + + + **Deprecated**: Use `transport=ServerTransportConfig(preferred=...)` instead. + + + + **Deprecated**: Use `signing_config=AgentCardSigningConfig(...)` instead. ### Combined Client and Server @@ -468,6 +500,14 @@ agent = Agent( ) ``` +### File Inputs and Structured Output + +A2A supports passing files and requesting structured output in both directions. + +**Client side**: When delegating to a remote A2A agent, files from the task's `input_files` are sent as `FilePart`s in the outgoing message. If `response_model` is set on the `A2AClientConfig`, the Pydantic model's JSON schema is embedded in the message metadata, requesting structured output from the remote agent. + +**Server side**: Incoming `FilePart`s are extracted and passed to the agent's task as `input_files`. If the client included a JSON schema, the server creates a response model from it and applies it to the task. When the agent returns structured data, the response is sent back as a `DataPart` rather than plain text. + ## Best Practices diff --git a/docs/en/learn/a2ui.mdx b/docs/en/learn/a2ui.mdx new file mode 100644 index 000000000..c34dd4b8e --- /dev/null +++ b/docs/en/learn/a2ui.mdx @@ -0,0 +1,344 @@ +--- +title: Agent-to-UI (A2UI) Protocol +description: Enable agents to generate declarative UI surfaces for rich client rendering via the A2UI extension. +icon: window-restore +mode: "wide" +--- + +## A2UI Overview + +A2UI is a declarative UI protocol extension for [A2A](/en/learn/a2a-agent-delegation) that lets agents emit structured JSON messages describing interactive surfaces. Clients receive these messages and render them as rich UI components — forms, cards, lists, modals, and more — without the agent needing to know anything about the client's rendering stack. + +A2UI is built on the A2A extension mechanism and identified by the URI `https://a2ui.org/a2a-extension/a2ui/v0.8`. + + + A2UI requires the `a2a-sdk` package. Install with: `uv add 'crewai[a2a]'` or `pip install 'crewai[a2a]'` + + +## How It Works + +1. The **server extension** scans agent output for A2UI JSON objects +2. Valid messages are wrapped as `DataPart` entries with the `application/json+a2ui` MIME type +3. The **client extension** augments the agent's system prompt with A2UI instructions and the component catalog +4. The client tracks surface state (active surfaces and data models) across conversation turns + +## Server Setup + +Add `A2UIServerExtension` to your `A2AServerConfig` to enable A2UI output: + +```python Code +from crewai import Agent +from crewai.a2a import A2AServerConfig +from crewai.a2a.extensions.a2ui import A2UIServerExtension + +agent = Agent( + role="Dashboard Agent", + goal="Present data through interactive UI surfaces", + backstory="Expert at building clear, actionable dashboards", + llm="gpt-4o", + a2a=A2AServerConfig( + url="https://your-server.com", + server_extensions=[A2UIServerExtension()], + ), +) +``` + +### Server Extension Options + + + Component catalog identifiers the server supports. When set, only these catalogs are advertised to clients. + + + + Whether to accept inline catalog definitions from clients in addition to named catalogs. + + +## Client Setup + +Add `A2UIClientExtension` to your `A2AClientConfig` to enable A2UI rendering: + +```python Code +from crewai import Agent +from crewai.a2a import A2AClientConfig +from crewai.a2a.extensions.a2ui import A2UIClientExtension + +agent = Agent( + role="UI Coordinator", + goal="Coordinate tasks and render agent responses as rich UI", + backstory="Expert at presenting agent output in interactive formats", + llm="gpt-4o", + a2a=A2AClientConfig( + endpoint="https://dashboard-agent.example.com/.well-known/agent-card.json", + client_extensions=[A2UIClientExtension()], + ), +) +``` + +### Client Extension Options + + + Preferred component catalog identifier. Defaults to `"standard (v0.8)"` when not set. + + + + Restrict which components the agent may use. When `None`, all 18 standard catalog components are available. + + +## Message Types + +A2UI defines four server-to-client message types. Each message targets a **surface** identified by `surfaceId`. + + + + Initializes a new surface with a root component and optional styles. + + ```json + { + "beginRendering": { + "surfaceId": "dashboard-1", + "root": "main-column", + "catalogId": "standard (v0.8)", + "styles": { + "primaryColor": "#EB6658" + } + } + } + ``` + + + + Sends or updates one or more components on an existing surface. + + ```json + { + "surfaceUpdate": { + "surfaceId": "dashboard-1", + "components": [ + { + "id": "main-column", + "component": { + "Column": { + "children": { "explicitList": ["title", "content"] }, + "alignment": "start" + } + } + }, + { + "id": "title", + "component": { + "Text": { + "text": { "literalString": "Dashboard" }, + "usageHint": "h1" + } + } + } + ] + } + } + ``` + + + + Updates the data model bound to a surface, enabling dynamic content. + + ```json + { + "dataModelUpdate": { + "surfaceId": "dashboard-1", + "path": "/data/model", + "contents": [ + { + "key": "userName", + "valueString": "Alice" + }, + { + "key": "score", + "valueNumber": 42 + } + ] + } + } + ``` + + + + Removes a surface and all its components. + + ```json + { + "deleteSurface": { + "surfaceId": "dashboard-1" + } + } + ``` + + + +## Component Catalog + +A2UI ships with 18 standard components organized into three categories: + +### Content + +| Component | Description | Required Fields | +|-----------|-------------|-----------------| +| **Text** | Renders text with optional heading/body hints | `text` (StringBinding) | +| **Image** | Displays an image with fit and size options | `url` (StringBinding) | +| **Icon** | Renders a named icon from a set of 47 icons | `name` (IconBinding) | +| **Video** | Embeds a video player | `url` (StringBinding) | +| **AudioPlayer** | Embeds an audio player with optional description | `url` (StringBinding) | + +### Layout + +| Component | Description | Required Fields | +|-----------|-------------|-----------------| +| **Row** | Horizontal flex container | `children` (ChildrenDef) | +| **Column** | Vertical flex container | `children` (ChildrenDef) | +| **List** | Scrollable list (vertical or horizontal) | `children` (ChildrenDef) | +| **Card** | Elevated container for a single child | `child` (str) | +| **Tabs** | Tabbed container | `tabItems` (list of TabItem) | +| **Divider** | Visual separator (horizontal or vertical) | — | +| **Modal** | Overlay triggered by an entry point | `entryPointChild`, `contentChild` (str) | + +### Interactive + +| Component | Description | Required Fields | +|-----------|-------------|-----------------| +| **Button** | Clickable button that triggers an action | `child` (str), `action` (Action) | +| **CheckBox** | Boolean toggle with a label | `label` (StringBinding), `value` (BooleanBinding) | +| **TextField** | Text input with type and validation options | `label` (StringBinding) | +| **DateTimeInput** | Date and/or time picker | `value` (StringBinding) | +| **MultipleChoice** | Selection from a list of options | `selections` (ArrayBinding), `options` (list) | +| **Slider** | Numeric range slider | `value` (NumberBinding) | + +## Data Binding + +Components reference values through **bindings** rather than raw literals. This allows surfaces to update dynamically when the data model changes. + +There are two ways to bind a value: + +- **Literal values** — hardcoded directly in the component definition +- **Path references** — point to a key in the surface's data model + +```json +{ + "surfaceUpdate": { + "surfaceId": "profile-1", + "components": [ + { + "id": "greeting", + "component": { + "Text": { + "text": { "path": "/data/model/userName" }, + "usageHint": "h2" + } + } + }, + { + "id": "status", + "component": { + "Text": { + "text": { "literalString": "Online" }, + "usageHint": "caption" + } + } + } + ] + } +} +``` + +In this example, `greeting` reads the user's name from the data model (updated via `dataModelUpdate`), while `status` uses a hardcoded literal. + +## Handling User Actions + +Interactive components like `Button` trigger `userAction` events that flow back to the server. Each action includes a `name`, the originating `surfaceId` and `sourceComponentId`, and an optional `context` with key-value pairs. + +```json +{ + "userAction": { + "name": "submitForm", + "surfaceId": "form-1", + "sourceComponentId": "submit-btn", + "timestamp": "2026-03-12T10:00:00Z", + "context": { + "selectedOption": "optionA" + } + } +} +``` + +Action context values can also use path bindings to send current data model values back to the server: + +```json +{ + "Button": { + "child": "confirm-label", + "action": { + "name": "confirm", + "context": [ + { + "key": "currentScore", + "value": { "path": "/data/model/score" } + } + ] + } + } +} +``` + +## Validation + +Use `validate_a2ui_message` to validate server-to-client messages and `validate_a2ui_event` for client-to-server events: + +```python Code +from crewai.a2a.extensions.a2ui import validate_a2ui_message +from crewai.a2a.extensions.a2ui.validator import ( + validate_a2ui_event, + A2UIValidationError, +) + +# Validate a server message +try: + msg = validate_a2ui_message({"beginRendering": {"surfaceId": "s1", "root": "r1"}}) +except A2UIValidationError as exc: + print(exc.errors) + +# Validate a client event +try: + event = validate_a2ui_event({ + "userAction": { + "name": "click", + "surfaceId": "s1", + "sourceComponentId": "btn-1", + "timestamp": "2026-03-12T10:00:00Z", + } + }) +except A2UIValidationError as exc: + print(exc.errors) +``` + +## Best Practices + + + + Begin with a `beginRendering` message and a single `surfaceUpdate`. Add data binding and interactivity once the basic flow works. + + + + Prefer path bindings over literal values for content that changes. Use `dataModelUpdate` to push new values without resending the full component tree. + + + + Use the `allowed_components` option on `A2UIClientExtension` to restrict which components the agent may emit, reducing prompt size and keeping output predictable. + + + + Use `validate_a2ui_message` and `validate_a2ui_event` to catch malformed payloads early, especially when building custom integrations. + + + +## Learn More + +- [A2A Agent Delegation](/en/learn/a2a-agent-delegation) — configure agents for remote delegation via the A2A protocol +- [A2A Protocol Documentation](https://a2a-protocol.org) — official protocol specification diff --git a/docs/en/learn/streaming-crew-execution.mdx b/docs/en/learn/streaming-crew-execution.mdx index bfcd0850d..ff0a3cd7f 100644 --- a/docs/en/learn/streaming-crew-execution.mdx +++ b/docs/en/learn/streaming-crew-execution.mdx @@ -325,6 +325,34 @@ Streaming is particularly valuable for: - **User Experience**: Reduce perceived latency by showing incremental results - **Live Dashboards**: Build monitoring interfaces that display crew execution status +## Cancellation and Resource Cleanup + +`CrewStreamingOutput` supports graceful cancellation so that in-flight work stops promptly when the consumer disconnects. + +### Async Context Manager + +```python Code +streaming = await crew.akickoff(inputs={"topic": "AI"}) + +async with streaming: + async for chunk in streaming: + print(chunk.content, end="", flush=True) +``` + +### Explicit Cancellation + +```python Code +streaming = await crew.akickoff(inputs={"topic": "AI"}) +try: + async for chunk in streaming: + print(chunk.content, end="", flush=True) +finally: + await streaming.aclose() # async + # streaming.close() # sync equivalent +``` + +After cancellation, `streaming.is_cancelled` and `streaming.is_completed` are both `True`. Both `aclose()` and `close()` are idempotent. + ## Important Notes - Streaming automatically enables LLM streaming for all agents in the crew diff --git a/docs/en/learn/streaming-flow-execution.mdx b/docs/en/learn/streaming-flow-execution.mdx index df0fec91d..31ca0f376 100644 --- a/docs/en/learn/streaming-flow-execution.mdx +++ b/docs/en/learn/streaming-flow-execution.mdx @@ -420,6 +420,34 @@ except Exception as e: print("Streaming completed but flow encountered an error") ``` +## Cancellation and Resource Cleanup + +`FlowStreamingOutput` supports graceful cancellation so that in-flight work stops promptly when the consumer disconnects. + +### Async Context Manager + +```python Code +streaming = await flow.kickoff_async() + +async with streaming: + async for chunk in streaming: + print(chunk.content, end="", flush=True) +``` + +### Explicit Cancellation + +```python Code +streaming = await flow.kickoff_async() +try: + async for chunk in streaming: + print(chunk.content, end="", flush=True) +finally: + await streaming.aclose() # async + # streaming.close() # sync equivalent +``` + +After cancellation, `streaming.is_cancelled` and `streaming.is_completed` are both `True`. Both `aclose()` and `close()` are idempotent. + ## Important Notes - Streaming automatically enables LLM streaming for any crews used within the flow diff --git a/docs/en/quickstart.mdx b/docs/en/quickstart.mdx index 0ad5d2612..3b1b76ddf 100644 --- a/docs/en/quickstart.mdx +++ b/docs/en/quickstart.mdx @@ -1,43 +1,49 @@ --- title: Quickstart -description: Build your first AI agent with CrewAI in under 5 minutes. +description: Build your first CrewAI Flow in minutes — orchestration, state, and an agent crew that produces a real report. icon: rocket mode: "wide" --- -## Build your first CrewAI Agent +### Watch: Building CrewAI Agents & Flows with Coding Agent Skills -Let's create a simple crew that will help us `research` and `report` on the `latest AI developments` for a given topic or subject. +Install our coding agent skills (Claude Code, Codex, ...) to quickly get your coding agents up and running with CrewAI. -Before we proceed, make sure you have finished installing CrewAI. -If you haven't installed them yet, you can do so by following the [installation guide](/en/installation). +You can install it with `npx skills add crewaiinc/skills` -Follow the steps below to get Crewing! 🚣‍♂️ + + +In this guide you will **create a Flow** that sets a research topic, runs a **crew with one agent** (a researcher using web search), and ends with a **markdown report** on disk. Flows are the recommended way to structure production apps: they own **state** and **execution order**, while **agents** do the work inside a crew step. + +If you have not installed CrewAI yet, follow the [installation guide](/en/installation) first. + +## Prerequisites + +- Python environment and the CrewAI CLI (see [installation](/en/installation)) +- An LLM configured with the right API keys — see [LLMs](/en/concepts/llms#setting-up-your-llm) +- A [Serper.dev](https://serper.dev/) API key (`SERPER_API_KEY`) for web search in this tutorial + +## Build your first Flow - - Create a new crew project by running the following command in your terminal. - This will create a new directory called `latest-ai-development` with the basic structure for your crew. + + From your terminal, scaffold a Flow project (the folder name uses underscores, e.g. `latest_ai_flow`): + ```shell Terminal - crewai create crew latest-ai-development + crewai create flow latest-ai-flow + cd latest_ai_flow ``` + + This creates a Flow app under `src/latest_ai_flow/`, including a starter crew under `crews/content_crew/` that you will replace with a minimal **single-agent** research crew in the next steps. - - - ```shell Terminal - cd latest_ai_development - ``` - - - - - You can also modify the agents as needed to fit your use case or copy and paste as is to your project. - Any variable interpolated in your `agents.yaml` and `tasks.yaml` files like `{topic}` will be replaced by the value of the variable in the `main.py` file. - + + + Replace the contents of `src/latest_ai_flow/crews/content_crew/config/agents.yaml` with a single researcher. Variables like `{topic}` are filled from `crew.kickoff(inputs=...)`. + ```yaml agents.yaml - # src/latest_ai_development/config/agents.yaml + # src/latest_ai_flow/crews/content_crew/config/agents.yaml researcher: role: > {topic} Senior Data Researcher @@ -45,336 +51,232 @@ Follow the steps below to get Crewing! 🚣‍♂️ Uncover cutting-edge developments in {topic} backstory: > You're a seasoned researcher with a knack for uncovering the latest - developments in {topic}. Known for your ability to find the most relevant - information and present it in a clear and concise manner. - - reporting_analyst: - role: > - {topic} Reporting Analyst - goal: > - Create detailed reports based on {topic} data analysis and research findings - backstory: > - You're a meticulous analyst with a keen eye for detail. You're known for - your ability to turn complex data into clear and concise reports, making - it easy for others to understand and act on the information you provide. + developments in {topic}. You find the most relevant information and + present it clearly. ``` - + + ```yaml tasks.yaml - # src/latest_ai_development/config/tasks.yaml + # src/latest_ai_flow/crews/content_crew/config/tasks.yaml research_task: description: > - Conduct a thorough research about {topic} - Make sure you find any interesting and relevant information given - the current year is 2025. + Conduct thorough research about {topic}. Use web search to find current, + credible information. The current year is 2026. expected_output: > - A list with 10 bullet points of the most relevant information about {topic} + A markdown report with clear sections: key trends, notable tools or companies, + and implications. Aim for 800–1200 words. No fenced code blocks around the whole document. agent: researcher - - reporting_task: - description: > - Review the context you got and expand each topic into a full section for a report. - Make sure the report is detailed and contains any and all relevant information. - expected_output: > - A fully fledge reports with the mains topics, each with a full section of information. - Formatted as markdown without '```' - agent: reporting_analyst - output_file: report.md + output_file: output/report.md ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task - from crewai_tools import SerperDevTool - from crewai.agents.agent_builder.base_agent import BaseAgent + + + Point the generated crew at your YAML and attach `SerperDevTool` to the researcher. + + ```python content_crew.py + # src/latest_ai_flow/crews/content_crew/content_crew.py from typing import List + from crewai import Agent, Crew, Process, Task + from crewai.agents.agent_builder.base_agent import BaseAgent + from crewai.project import CrewBase, agent, crew, task + from crewai_tools import SerperDevTool + + @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + class ResearchCrew: + """Single-agent research crew used inside the Flow.""" agents: List[BaseAgent] tasks: List[Task] + agents_config = "config/agents.yaml" + tasks_config = "config/tasks.yaml" + @agent def researcher(self) -> Agent: return Agent( - config=self.agents_config['researcher'], # type: ignore[index] + config=self.agents_config["researcher"], # type: ignore[index] verbose=True, - tools=[SerperDevTool()] - ) - - @agent - def reporting_analyst(self) -> Agent: - return Agent( - config=self.agents_config['reporting_analyst'], # type: ignore[index] - verbose=True + tools=[SerperDevTool()], ) @task def research_task(self) -> Task: return Task( - config=self.tasks_config['research_task'], # type: ignore[index] - ) - - @task - def reporting_task(self) -> Task: - return Task( - config=self.tasks_config['reporting_task'], # type: ignore[index] - output_file='output/report.md' # This is the file that will be contain the final report. + config=self.tasks_config["research_task"], # type: ignore[index] ) @crew def crew(self) -> Crew: - """Creates the LatestAiDevelopment crew""" return Crew( - agents=self.agents, # Automatically created by the @agent decorator - tasks=self.tasks, # Automatically created by the @task decorator + agents=self.agents, + tasks=self.tasks, process=Process.sequential, verbose=True, ) ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task, before_kickoff, after_kickoff - from crewai_tools import SerperDevTool - @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + + Connect the crew to a Flow: a `@start()` step sets the topic in **state**, and a `@listen` step runs the crew. The task’s `output_file` still writes `output/report.md`. - @before_kickoff - def before_kickoff_function(self, inputs): - print(f"Before kickoff function with inputs: {inputs}") - return inputs # You can return the inputs or modify them as needed - - @after_kickoff - def after_kickoff_function(self, result): - print(f"After kickoff function with result: {result}") - return result # You can return the result or modify it as needed - - # ... remaining code - ``` - - - - For example, you can pass the `topic` input to your crew to customize the research and reporting. ```python main.py - #!/usr/bin/env python - # src/latest_ai_development/main.py - import sys - from latest_ai_development.crew import LatestAiDevelopmentCrew + # src/latest_ai_flow/main.py + from pydantic import BaseModel - def run(): - """ - Run the crew. - """ - inputs = { - 'topic': 'AI Agents' - } - LatestAiDevelopmentCrew().crew().kickoff(inputs=inputs) + from crewai.flow import Flow, listen, start + + from latest_ai_flow.crews.content_crew.content_crew import ResearchCrew + + + class ResearchFlowState(BaseModel): + topic: str = "" + report: str = "" + + + class LatestAiFlow(Flow[ResearchFlowState]): + @start() + def prepare_topic(self, crewai_trigger_payload: dict | None = None): + if crewai_trigger_payload: + self.state.topic = crewai_trigger_payload.get("topic", "AI Agents") + else: + self.state.topic = "AI Agents" + print(f"Topic: {self.state.topic}") + + @listen(prepare_topic) + def run_research(self): + result = ResearchCrew().crew().kickoff(inputs={"topic": self.state.topic}) + self.state.report = result.raw + print("Research crew finished.") + + @listen(run_research) + def summarize(self): + print("Report path: output/report.md") + + + def kickoff(): + LatestAiFlow().kickoff() + + + def plot(): + LatestAiFlow().plot() + + + if __name__ == "__main__": + kickoff() ``` - - - Before running your crew, make sure you have the following keys set as environment variables in your `.env` file: - - A [Serper.dev](https://serper.dev/) API key: `SERPER_API_KEY=YOUR_KEY_HERE` - - The configuration for your choice of model, such as an API key. See the - [LLM setup guide](/en/concepts/llms#setting-up-your-llm) to learn how to configure models from any provider. - - - - Lock the dependencies and install them by using the CLI command: - - ```shell Terminal - crewai install - ``` - - - If you have additional packages that you want to install, you can do so by running: - - ```shell Terminal - uv add - ``` - - - - - To run your crew, execute the following command in the root of your project: - - ```bash Terminal - crewai run - ``` - + + If your package name differs from `latest_ai_flow`, change the import of `ResearchCrew` to match your project’s module path. + - - For CrewAI AMP users, you can create the same crew without writing code: + + In `.env` at the project root, set: -1. Log in to your CrewAI AMP account (create a free account at [app.crewai.com](https://app.crewai.com)) -2. Open Crew Studio -3. Type what is the automation you're trying to build -4. Create your tasks visually and connect them in sequence -5. Configure your inputs and click "Download Code" or "Deploy" - -![Crew Studio Quickstart](/images/enterprise/crew-studio-interface.png) - - - Start your free account at CrewAI AMP - + - `SERPER_API_KEY` — from [Serper.dev](https://serper.dev/) + - Your model provider keys as required — see [LLM setup](/en/concepts/llms#setting-up-your-llm) - - You should see the output in the console and the `report.md` file should be created in the root of your project with the final report. -Here's an example of what the report should look like: + + + ```shell Terminal + crewai install + crewai run + ``` + + + `crewai run` executes the Flow entrypoint defined in your project (same command as for crews; project type is `"flow"` in `pyproject.toml`). + + + + + + + You should see logs from the Flow and the crew. Open **`output/report.md`** for the generated report (excerpt): ```markdown output/report.md - # Comprehensive Report on the Rise and Impact of AI Agents in 2025 + # AI Agents in 2026: Landscape and Trends - ## 1. Introduction to AI Agents - In 2025, Artificial Intelligence (AI) agents are at the forefront of innovation across various industries. As intelligent systems that can perform tasks typically requiring human cognition, AI agents are paving the way for significant advancements in operational efficiency, decision-making, and overall productivity within sectors like Human Resources (HR) and Finance. This report aims to detail the rise of AI agents, their frameworks, applications, and potential implications on the workforce. + ## Executive summary + … - ## 2. Benefits of AI Agents - AI agents bring numerous advantages that are transforming traditional work environments. Key benefits include: + ## Key trends + - **Tool use and orchestration** — … + - **Enterprise adoption** — … - - **Task Automation**: AI agents can carry out repetitive tasks such as data entry, scheduling, and payroll processing without human intervention, greatly reducing the time and resources spent on these activities. - - **Improved Efficiency**: By quickly processing large datasets and performing analyses that would take humans significantly longer, AI agents enhance operational efficiency. This allows teams to focus on strategic tasks that require higher-level thinking. - - **Enhanced Decision-Making**: AI agents can analyze trends and patterns in data, provide insights, and even suggest actions, helping stakeholders make informed decisions based on factual data rather than intuition alone. - - ## 3. Popular AI Agent Frameworks - Several frameworks have emerged to facilitate the development of AI agents, each with its own unique features and capabilities. Some of the most popular frameworks include: - - - **Autogen**: A framework designed to streamline the development of AI agents through automation of code generation. - - **Semantic Kernel**: Focuses on natural language processing and understanding, enabling agents to comprehend user intentions better. - - **Promptflow**: Provides tools for developers to create conversational agents that can navigate complex interactions seamlessly. - - **Langchain**: Specializes in leveraging various APIs to ensure agents can access and utilize external data effectively. - - **CrewAI**: Aimed at collaborative environments, CrewAI strengthens teamwork by facilitating communication through AI-driven insights. - - **MemGPT**: Combines memory-optimized architectures with generative capabilities, allowing for more personalized interactions with users. - - These frameworks empower developers to build versatile and intelligent agents that can engage users, perform advanced analytics, and execute various tasks aligned with organizational goals. - - ## 4. AI Agents in Human Resources - AI agents are revolutionizing HR practices by automating and optimizing key functions: - - - **Recruiting**: AI agents can screen resumes, schedule interviews, and even conduct initial assessments, thus accelerating the hiring process while minimizing biases. - - **Succession Planning**: AI systems analyze employee performance data and potential, helping organizations identify future leaders and plan appropriate training. - - **Employee Engagement**: Chatbots powered by AI can facilitate feedback loops between employees and management, promoting an open culture and addressing concerns promptly. - - As AI continues to evolve, HR departments leveraging these agents can realize substantial improvements in both efficiency and employee satisfaction. - - ## 5. AI Agents in Finance - The finance sector is seeing extensive integration of AI agents that enhance financial practices: - - - **Expense Tracking**: Automated systems manage and monitor expenses, flagging anomalies and offering recommendations based on spending patterns. - - **Risk Assessment**: AI models assess credit risk and uncover potential fraud by analyzing transaction data and behavioral patterns. - - **Investment Decisions**: AI agents provide stock predictions and analytics based on historical data and current market conditions, empowering investors with informative insights. - - The incorporation of AI agents into finance is fostering a more responsive and risk-aware financial landscape. - - ## 6. Market Trends and Investments - The growth of AI agents has attracted significant investment, especially amidst the rising popularity of chatbots and generative AI technologies. Companies and entrepreneurs are eager to explore the potential of these systems, recognizing their ability to streamline operations and improve customer engagement. - - Conversely, corporations like Microsoft are taking strides to integrate AI agents into their product offerings, with enhancements to their Copilot 365 applications. This strategic move emphasizes the importance of AI literacy in the modern workplace and indicates the stabilizing of AI agents as essential business tools. - - ## 7. Future Predictions and Implications - Experts predict that AI agents will transform essential aspects of work life. As we look toward the future, several anticipated changes include: - - - Enhanced integration of AI agents across all business functions, creating interconnected systems that leverage data from various departmental silos for comprehensive decision-making. - - Continued advancement of AI technologies, resulting in smarter, more adaptable agents capable of learning and evolving from user interactions. - - Increased regulatory scrutiny to ensure ethical use, especially concerning data privacy and employee surveillance as AI agents become more prevalent. - - To stay competitive and harness the full potential of AI agents, organizations must remain vigilant about latest developments in AI technology and consider continuous learning and adaptation in their strategic planning. - - ## 8. Conclusion - The emergence of AI agents is undeniably reshaping the workplace landscape in 5. With their ability to automate tasks, enhance efficiency, and improve decision-making, AI agents are critical in driving operational success. Organizations must embrace and adapt to AI developments to thrive in an increasingly digital business environment. + ## Implications + … ``` - + + Your actual file will be longer and reflect live search results. +## How this run fits together + +1. **Flow** — `LatestAiFlow` runs `prepare_topic` first, then `run_research`, then `summarize`. State (`topic`, `report`) lives on the Flow. +2. **Crew** — `ResearchCrew` runs one task with one agent: the researcher uses **Serper** to search the web, then writes the structured report. +3. **Artifact** — The task’s `output_file` writes the report under `output/report.md`. + +To go deeper on Flow patterns (routing, persistence, human-in-the-loop), see [Build your first Flow](/en/guides/flows/first-flow) and [Flows](/en/concepts/flows). For crews without a Flow, see [Crews](/en/concepts/crews). For a single `Agent` and `kickoff()` without tasks, see [Agents](/en/concepts/agents#direct-agent-interaction-with-kickoff). + -Congratulations! - -You have successfully set up your crew project and are ready to start building your own agentic workflows! - +You now have an end-to-end Flow with an agent crew and a saved report — a solid base to add more steps, crews, or tools. -### Note on Consistency in Naming +### Naming consistency -The names you use in your YAML files (`agents.yaml` and `tasks.yaml`) should match the method names in your Python code. -For example, you can reference the agent for specific tasks from `tasks.yaml` file. -This naming consistency allows CrewAI to automatically link your configurations with your code; otherwise, your task won't recognize the reference properly. +YAML keys (`researcher`, `research_task`) must match the method names on your `@CrewBase` class. See [Crews](/en/concepts/crews) for the full decorator pattern. -#### Example References +## Deploying - - Note how we use the same name for the agent in the `agents.yaml` - (`email_summarizer`) file as the method name in the `crew.py` - (`email_summarizer`) file. - +Push your Flow to **[CrewAI AMP](https://app.crewai.com)** once it runs locally and your project is in a **GitHub** repository. From the project root: -```yaml agents.yaml -email_summarizer: - role: > - Email Summarizer - goal: > - Summarize emails into a concise and clear summary - backstory: > - You will create a 5 bullet point summary of the report - llm: provider/model-id # Add your choice of model here + +```bash Authenticate +crewai login ``` - - Note how we use the same name for the task in the `tasks.yaml` - (`email_summarizer_task`) file as the method name in the `crew.py` - (`email_summarizer_task`) file. - - -```yaml tasks.yaml -email_summarizer_task: - description: > - Summarize the email into a 5 bullet point summary - expected_output: > - A 5 bullet point summary of the email - agent: email_summarizer - context: - - reporting_task - - research_task +```bash Create deployment +crewai deploy create ``` -## Deploying Your Crew +```bash Check status & logs +crewai deploy status +crewai deploy logs +``` -The easiest way to deploy your crew to production is through [CrewAI AMP](http://app.crewai.com). +```bash Ship updates after you change code +crewai deploy push +``` -Watch this video tutorial for a step-by-step demonstration of deploying your crew to [CrewAI AMP](http://app.crewai.com) using the CLI. +```bash List or remove deployments +crewai deploy list +crewai deploy remove +``` + - + + The first deploy usually takes **around 1 minute**. Full prerequisites and the web UI flow are in [Deploy to AMP](/en/enterprise/guides/deploy-to-amp). + - - Get started with CrewAI AMP and deploy your crew in a production environment - with just a few clicks. + + Step-by-step AMP deployment (CLI and dashboard). - Join our open source community to discuss ideas, share your projects, and - connect with other CrewAI developers. + Discuss ideas, share projects, and connect with other CrewAI developers. diff --git a/docs/en/skills.mdx b/docs/en/skills.mdx new file mode 100644 index 000000000..81260c88f --- /dev/null +++ b/docs/en/skills.mdx @@ -0,0 +1,50 @@ +--- +title: Skills +description: Install crewaiinc/skills from the official registry at skills.sh—Flows, Crews, and docs-aware agents for Claude Code, Cursor, Codex, and more. +icon: wand-magic-sparkles +mode: "wide" +--- + +# Skills + +**Give your AI coding agent CrewAI context in one command.** + +CrewAI **Skills** are published on **[skills.sh/crewaiinc/skills](https://skills.sh/crewaiinc/skills)**—the official registry for `crewaiinc/skills`, including individual skills (for example **design-agent**, **getting-started**, **design-task**, and **ask-docs**), install stats, and audits. They teach coding agents—like Claude Code, Cursor, and Codex—how to scaffold Flows, configure Crews, use tools, and follow CrewAI patterns. Run the install below (or paste it into your agent). + +```shell Terminal +npx skills add crewaiinc/skills +``` + +That pulls the official skill pack into your agent workflow so it can apply CrewAI conventions without you re-explaining the framework each session. Source code and issues live on [GitHub](https://github.com/crewAIInc/skills). + +## What your agent gets + +- **Flows** — structure stateful apps, steps, and crew kickoffs the CrewAI way +- **Crews & agents** — YAML-first patterns, roles, tasks, and delegation +- **Tools & integrations** — hook agents to search, APIs, and common CrewAI tools +- **Project layout** — align with CLI scaffolds and repo conventions +- **Up-to-date patterns** — skills track current CrewAI docs and recommended practices + +## Learn more on this site + + + + How to use `AGENTS.md` and coding-agent workflows with CrewAI. + + + Build your first Flow and crew end-to-end. + + + Install the CrewAI CLI and Python package. + + + Official listing for `crewaiinc/skills`—skills, installs, and audits. + + + Source, updates, and issues for the skill pack. + + + +### Video: CrewAI with coding agent skills + + + ## 비디오 튜토리얼 설치 과정을 단계별로 시연하는 비디오 튜토리얼을 시청하세요: @@ -189,9 +197,8 @@ CrewAI는 의존성 관리와 패키지 처리를 위해 `uv`를 사용합니다 ## 다음 단계 - - 빠른 시작 가이드를 따라 CrewAI 에이전트를 처음 만들어보고 직접 경험해 - 보세요. + + Flow를 만들고 에이전트 한 명짜리 crew를 실행해 보고서까지 만드는 방법을 따라 해 보세요. + ## CrewAI 아키텍처 CrewAI의 아키텍처는 자율성과 제어의 균형을 맞추도록 설계되었습니다. @@ -130,9 +138,9 @@ Crews의 기능: - 빠른 시작 가이드를 따라 첫 번째 CrewAI agent를 만들고 직접 경험해 보세요. + Flow를 만들고 에이전트 한 명 crew를 실행해 끝까지 보고서를 생성해 보세요. + +이 가이드에서는 **Flow**를 만들어 연구 주제를 정하고, **에이전트 한 명으로 구성된 crew**(웹 검색을 쓰는 연구원)를 실행한 뒤, 디스크에 **Markdown 보고서**를 남깁니다. Flow는 프로덕션 앱을 구성하는 권장 방식으로, **상태**와 **실행 순서**를 담당하고 **에이전트**는 crew 단계 안에서 실제 작업을 수행합니다. + +CrewAI를 아직 설치하지 않았다면 먼저 [설치 가이드](/ko/installation)를 따르세요. + +## 사전 요건 + +- Python 환경과 CrewAI CLI([설치](/ko/installation) 참고) +- 올바른 API 키로 설정한 LLM — [LLM](/ko/concepts/llms#setting-up-your-llm) 참고 +- 이 튜토리얼의 웹 검색용 [Serper.dev](https://serper.dev/) API 키(`SERPER_API_KEY`) + +## 첫 번째 Flow 만들기 - - 터미널에서 아래 명령어를 실행하여 새로운 crew 프로젝트를 만드세요. - 이 작업은 `latest-ai-development`라는 새 디렉터리와 기본 구조를 생성합니다. + + 터미널에서 Flow 프로젝트를 생성합니다(폴더 이름은 밑줄 형식입니다. 예: `latest_ai_flow`). + ```shell Terminal - crewai create crew latest-ai-development + crewai create flow latest-ai-flow + cd latest_ai_flow ``` + + 이렇게 하면 `src/latest_ai_flow/` 아래에 Flow 앱이 만들어지고, 다음 단계에서 **단일 에이전트** 연구 crew로 바꿀 시작용 crew가 `crews/content_crew/`에 포함됩니다. - - - ```shell Terminal - cd latest_ai_development - ``` - - - - - 프로젝트에 맞게 agent를 수정하거나 복사/붙여넣기를 할 수 있습니다. - `agents.yaml` 및 `tasks.yaml` 파일에서 `{topic}`과 같은 변수를 사용하면, 이는 `main.py` 파일의 변수 값으로 대체됩니다. - + + + `src/latest_ai_flow/crews/content_crew/config/agents.yaml` 내용을 한 명의 연구원만 남기도록 바꿉니다. `{topic}` 같은 변수는 `crew.kickoff(inputs=...)`로 채워집니다. + ```yaml agents.yaml - # src/latest_ai_development/config/agents.yaml + # src/latest_ai_flow/crews/content_crew/config/agents.yaml researcher: role: > - {topic} Senior Data Researcher + {topic} 시니어 데이터 리서처 goal: > - Uncover cutting-edge developments in {topic} + {topic} 분야의 최신 동향을 파악한다 backstory: > - You're a seasoned researcher with a knack for uncovering the latest - developments in {topic}. Known for your ability to find the most relevant - information and present it in a clear and concise manner. - - reporting_analyst: - role: > - {topic} Reporting Analyst - goal: > - Create detailed reports based on {topic} data analysis and research findings - backstory: > - You're a meticulous analyst with a keen eye for detail. You're known for - your ability to turn complex data into clear and concise reports, making - it easy for others to understand and act on the information you provide. + 당신은 {topic}의 최신 흐름을 찾아내는 데 능숙한 연구원입니다. + 가장 관련성 높은 정보를 찾아 명확하게 전달합니다. ``` - + + ```yaml tasks.yaml - # src/latest_ai_development/config/tasks.yaml + # src/latest_ai_flow/crews/content_crew/config/tasks.yaml research_task: description: > - Conduct a thorough research about {topic} - Make sure you find any interesting and relevant information given - the current year is 2025. + {topic}에 대해 철저히 조사하세요. 웹 검색으로 최신이고 신뢰할 수 있는 정보를 찾으세요. + 현재 연도는 2026년입니다. expected_output: > - A list with 10 bullet points of the most relevant information about {topic} + 마크다운 보고서로, 주요 트렌드·주목할 도구나 기업·시사점 등으로 섹션을 나누세요. + 분량은 약 800~1200단어. 문서 전체를 코드 펜스로 감싸지 마세요. agent: researcher - - reporting_task: - description: > - Review the context you got and expand each topic into a full section for a report. - Make sure the report is detailed and contains any and all relevant information. - expected_output: > - A fully fledge reports with the mains topics, each with a full section of information. - Formatted as markdown without '```' - agent: reporting_analyst - output_file: report.md + output_file: output/report.md ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task - from crewai_tools import SerperDevTool - from crewai.agents.agent_builder.base_agent import BaseAgent + + + 생성된 crew가 YAML을 읽고 연구원에게 `SerperDevTool`을 붙이도록 합니다. + + ```python content_crew.py + # src/latest_ai_flow/crews/content_crew/content_crew.py from typing import List + from crewai import Agent, Crew, Process, Task + from crewai.agents.agent_builder.base_agent import BaseAgent + from crewai.project import CrewBase, agent, crew, task + from crewai_tools import SerperDevTool + + @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + class ResearchCrew: + """Flow 안에서 사용하는 단일 에이전트 연구 crew.""" agents: List[BaseAgent] tasks: List[Task] + agents_config = "config/agents.yaml" + tasks_config = "config/tasks.yaml" + @agent def researcher(self) -> Agent: return Agent( - config=self.agents_config['researcher'], # type: ignore[index] + config=self.agents_config["researcher"], # type: ignore[index] verbose=True, - tools=[SerperDevTool()] - ) - - @agent - def reporting_analyst(self) -> Agent: - return Agent( - config=self.agents_config['reporting_analyst'], # type: ignore[index] - verbose=True + tools=[SerperDevTool()], ) @task def research_task(self) -> Task: return Task( - config=self.tasks_config['research_task'], # type: ignore[index] - ) - - @task - def reporting_task(self) -> Task: - return Task( - config=self.tasks_config['reporting_task'], # type: ignore[index] - output_file='output/report.md' # This is the file that will be contain the final report. + config=self.tasks_config["research_task"], # type: ignore[index] ) @crew def crew(self) -> Crew: - """Creates the LatestAiDevelopment crew""" return Crew( - agents=self.agents, # Automatically created by the @agent decorator - tasks=self.tasks, # Automatically created by the @task decorator + agents=self.agents, + tasks=self.tasks, process=Process.sequential, verbose=True, ) ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task, before_kickoff, after_kickoff - from crewai_tools import SerperDevTool - @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + + crew를 Flow에 연결합니다: `@start()` 단계에서 주제를 **상태**에 넣고, `@listen` 단계에서 crew를 실행합니다. 작업의 `output_file`은 그대로 `output/report.md`에 씁니다. - @before_kickoff - def before_kickoff_function(self, inputs): - print(f"Before kickoff function with inputs: {inputs}") - return inputs # You can return the inputs or modify them as needed - - @after_kickoff - def after_kickoff_function(self, result): - print(f"After kickoff function with result: {result}") - return result # You can return the result or modify it as needed - - # ... remaining code - ``` - - - - 예를 들어, crew에 `topic` 입력값을 넘겨 연구 및 보고서 출력을 맞춤화할 수 있습니다. ```python main.py - #!/usr/bin/env python - # src/latest_ai_development/main.py - import sys - from latest_ai_development.crew import LatestAiDevelopmentCrew + # src/latest_ai_flow/main.py + from pydantic import BaseModel - def run(): - """ - Run the crew. - """ - inputs = { - 'topic': 'AI Agents' - } - LatestAiDevelopmentCrew().crew().kickoff(inputs=inputs) + from crewai.flow import Flow, listen, start + + from latest_ai_flow.crews.content_crew.content_crew import ResearchCrew + + + class ResearchFlowState(BaseModel): + topic: str = "" + report: str = "" + + + class LatestAiFlow(Flow[ResearchFlowState]): + @start() + def prepare_topic(self, crewai_trigger_payload: dict | None = None): + if crewai_trigger_payload: + self.state.topic = crewai_trigger_payload.get("topic", "AI Agents") + else: + self.state.topic = "AI Agents" + print(f"주제: {self.state.topic}") + + @listen(prepare_topic) + def run_research(self): + result = ResearchCrew().crew().kickoff(inputs={"topic": self.state.topic}) + self.state.report = result.raw + print("연구 crew 실행 완료.") + + @listen(run_research) + def summarize(self): + print("보고서 경로: output/report.md") + + + def kickoff(): + LatestAiFlow().kickoff() + + + def plot(): + LatestAiFlow().plot() + + + if __name__ == "__main__": + kickoff() ``` - - - crew를 실행하기 전에 `.env` 파일에 아래 키가 환경 변수로 설정되어 있는지 확인하세요: - - [Serper.dev](https://serper.dev/) API 키: `SERPER_API_KEY=YOUR_KEY_HERE` - - 사용하려는 모델의 설정, 예: API 키. 다양한 공급자의 모델 설정은 - [LLM 설정 가이드](/ko/concepts/llms#setting-up-your-llm)를 참고하세요. - - - - CLI 명령어로 의존성을 잠그고 설치하세요: - - ```shell Terminal - crewai install - ``` - - - 추가 설치가 필요한 패키지가 있다면, 아래와 같이 실행하면 됩니다: - - ```shell Terminal - uv add - ``` - - - - - 프로젝트 루트에서 다음 명령어로 crew를 실행하세요: - - ```bash Terminal - crewai run - ``` - + + 패키지 이름이 `latest_ai_flow`가 아니면 `ResearchCrew` import 경로를 프로젝트 모듈 경로에 맞게 바꾸세요. + - - CrewAI AMP 사용자는 코드를 작성하지 않고도 동일한 crew를 생성할 수 있습니다: + + 프로젝트 루트의 `.env`에 다음을 설정합니다. -1. CrewAI AMP 계정에 로그인하세요([app.crewai.com](https://app.crewai.com)에서 무료 계정 만들기) -2. Crew Studio 열기 -3. 구현하려는 자동화 내용을 입력하세요 -4. 미션을 시각적으로 생성하고 순차적으로 연결하세요 -5. 입력값을 구성하고 "Download Code" 또는 "Deploy"를 클릭하세요 - -![Crew Studio Quickstart](/images/enterprise/crew-studio-interface.png) - - - CrewAI AOP에서 무료 계정을 시작하세요 - + - `SERPER_API_KEY` — [Serper.dev](https://serper.dev/)에서 발급 + - 모델 제공자 키 — [LLM 설정](/ko/concepts/llms#setting-up-your-llm) 참고 - - 콘솔에서 출력 결과를 확인할 수 있으며 프로젝트 루트에 `report.md` 파일로 최종 보고서가 생성됩니다. -보고서 예시는 다음과 같습니다: + + + ```shell Terminal + crewai install + crewai run + ``` + + + `crewai run`은 프로젝트에 정의된 Flow 진입점을 실행합니다(crew와 동일한 명령이며, `pyproject.toml`의 프로젝트 유형은 `"flow"`입니다). + + + + Flow와 crew 로그가 출력되어야 합니다. 생성된 보고서는 **`output/report.md`**에서 확인하세요(발췌): ```markdown output/report.md - # Comprehensive Report on the Rise and Impact of AI Agents in 2025 + # 2026년 AI 에이전트: 동향과 전망 - ## 1. Introduction to AI Agents - In 2025, Artificial Intelligence (AI) agents are at the forefront of innovation across various industries. As intelligent systems that can perform tasks typically requiring human cognition, AI agents are paving the way for significant advancements in operational efficiency, decision-making, and overall productivity within sectors like Human Resources (HR) and Finance. This report aims to detail the rise of AI agents, their frameworks, applications, and potential implications on the workforce. + ## 요약 + … - ## 2. Benefits of AI Agents - AI agents bring numerous advantages that are transforming traditional work environments. Key benefits include: + ## 주요 트렌드 + - **도구 사용과 오케스트레이션** — … + - **엔터프라이즈 도입** — … - - **Task Automation**: AI agents can carry out repetitive tasks such as data entry, scheduling, and payroll processing without human intervention, greatly reducing the time and resources spent on these activities. - - **Improved Efficiency**: By quickly processing large datasets and performing analyses that would take humans significantly longer, AI agents enhance operational efficiency. This allows teams to focus on strategic tasks that require higher-level thinking. - - **Enhanced Decision-Making**: AI agents can analyze trends and patterns in data, provide insights, and even suggest actions, helping stakeholders make informed decisions based on factual data rather than intuition alone. - - ## 3. Popular AI Agent Frameworks - Several frameworks have emerged to facilitate the development of AI agents, each with its own unique features and capabilities. Some of the most popular frameworks include: - - - **Autogen**: A framework designed to streamline the development of AI agents through automation of code generation. - - **Semantic Kernel**: Focuses on natural language processing and understanding, enabling agents to comprehend user intentions better. - - **Promptflow**: Provides tools for developers to create conversational agents that can navigate complex interactions seamlessly. - - **Langchain**: Specializes in leveraging various APIs to ensure agents can access and utilize external data effectively. - - **CrewAI**: Aimed at collaborative environments, CrewAI strengthens teamwork by facilitating communication through AI-driven insights. - - **MemGPT**: Combines memory-optimized architectures with generative capabilities, allowing for more personalized interactions with users. - - These frameworks empower developers to build versatile and intelligent agents that can engage users, perform advanced analytics, and execute various tasks aligned with organizational goals. - - ## 4. AI Agents in Human Resources - AI agents are revolutionizing HR practices by automating and optimizing key functions: - - - **Recruiting**: AI agents can screen resumes, schedule interviews, and even conduct initial assessments, thus accelerating the hiring process while minimizing biases. - - **Succession Planning**: AI systems analyze employee performance data and potential, helping organizations identify future leaders and plan appropriate training. - - **Employee Engagement**: Chatbots powered by AI can facilitate feedback loops between employees and management, promoting an open culture and addressing concerns promptly. - - As AI continues to evolve, HR departments leveraging these agents can realize substantial improvements in both efficiency and employee satisfaction. - - ## 5. AI Agents in Finance - The finance sector is seeing extensive integration of AI agents that enhance financial practices: - - - **Expense Tracking**: Automated systems manage and monitor expenses, flagging anomalies and offering recommendations based on spending patterns. - - **Risk Assessment**: AI models assess credit risk and uncover potential fraud by analyzing transaction data and behavioral patterns. - - **Investment Decisions**: AI agents provide stock predictions and analytics based on historical data and current market conditions, empowering investors with informative insights. - - The incorporation of AI agents into finance is fostering a more responsive and risk-aware financial landscape. - - ## 6. Market Trends and Investments - The growth of AI agents has attracted significant investment, especially amidst the rising popularity of chatbots and generative AI technologies. Companies and entrepreneurs are eager to explore the potential of these systems, recognizing their ability to streamline operations and improve customer engagement. - - Conversely, corporations like Microsoft are taking strides to integrate AI agents into their product offerings, with enhancements to their Copilot 365 applications. This strategic move emphasizes the importance of AI literacy in the modern workplace and indicates the stabilizing of AI agents as essential business tools. - - ## 7. Future Predictions and Implications - Experts predict that AI agents will transform essential aspects of work life. As we look toward the future, several anticipated changes include: - - - Enhanced integration of AI agents across all business functions, creating interconnected systems that leverage data from various departmental silos for comprehensive decision-making. - - Continued advancement of AI technologies, resulting in smarter, more adaptable agents capable of learning and evolving from user interactions. - - Increased regulatory scrutiny to ensure ethical use, especially concerning data privacy and employee surveillance as AI agents become more prevalent. - - To stay competitive and harness the full potential of AI agents, organizations must remain vigilant about latest developments in AI technology and consider continuous learning and adaptation in their strategic planning. - - ## 8. Conclusion - The emergence of AI agents is undeniably reshaping the workplace landscape in 5. With their ability to automate tasks, enhance efficiency, and improve decision-making, AI agents are critical in driving operational success. Organizations must embrace and adapt to AI developments to thrive in an increasingly digital business environment. + ## 시사점 + … ``` - + + 실제 파일은 더 길고 실시간 검색 결과를 반영합니다. +## 한 번에 이해하기 + +1. **Flow** — `LatestAiFlow`는 `prepare_topic` → `run_research` → `summarize` 순으로 실행됩니다. 상태(`topic`, `report`)는 Flow에 있습니다. +2. **Crew** — `ResearchCrew`는 에이전트 한 명·작업 하나로 실행됩니다. 연구원이 **Serper**로 웹을 검색하고 구조화된 보고서를 씁니다. +3. **결과물** — 작업의 `output_file`이 `output/report.md`에 보고서를 씁니다. + +Flow 패턴(라우팅, 지속성, human-in-the-loop)을 더 보려면 [첫 Flow 만들기](/ko/guides/flows/first-flow)와 [Flows](/ko/concepts/flows)를 참고하세요. Flow 없이 crew만 쓰려면 [Crews](/ko/concepts/crews)를, 작업 없이 단일 `Agent`의 `kickoff()`만 쓰려면 [Agents](/ko/concepts/agents#direct-agent-interaction-with-kickoff)를 참고하세요. + -축하합니다! - -crew 프로젝트 설정이 완료되었으며, 이제 자신만의 agentic workflow 구축을 바로 시작하실 수 있습니다! - +에이전트 crew와 저장된 보고서까지 이어진 Flow를 완성했습니다. 이제 단계·crew·도구를 더해 확장할 수 있습니다. -### 명명 일관성에 대한 참고 +### 이름 일치 -YAML 파일(`agents.yaml` 및 `tasks.yaml`)에서 사용하는 이름은 Python 코드의 메서드 이름과 일치해야 합니다. -예를 들어, 특정 task에 대한 agent를 `tasks.yaml` 파일에서 참조할 수 있습니다. -이러한 명명 일관성을 지키면 CrewAI가 설정과 코드를 자동으로 연결할 수 있습니다. 그렇지 않으면 task가 참조를 제대로 인식하지 못할 수 있습니다. +YAML 키(`researcher`, `research_task`)는 `@CrewBase` 클래스의 메서드 이름과 같아야 합니다. 전체 데코레이터 패턴은 [Crews](/ko/concepts/crews)를 참고하세요. -#### 예시 참조 +## 배포 - - `agents.yaml` (`email_summarizer`) 파일에서 에이전트 이름과 `crew.py` - (`email_summarizer`) 파일에서 메서드 이름이 동일하게 사용되는 점에 주목하세요. - +로컬에서 정상 실행되고 프로젝트가 **GitHub** 저장소에 있으면 Flow를 **[CrewAI AMP](https://app.crewai.com)**에 올릴 수 있습니다. 프로젝트 루트에서: -```yaml agents.yaml -email_summarizer: - role: > - Email Summarizer - goal: > - Summarize emails into a concise and clear summary - backstory: > - You will create a 5 bullet point summary of the report - llm: provider/model-id # Add your choice of model here + +```bash 인증 +crewai login ``` - - `tasks.yaml` (`email_summarizer_task`) 파일에서 태스크 이름과 `crew.py` - (`email_summarizer_task`) 파일에서 메서드 이름이 동일하게 사용되는 점에 - 주목하세요. - - -```yaml tasks.yaml -email_summarizer_task: - description: > - Summarize the email into a 5 bullet point summary - expected_output: > - A 5 bullet point summary of the email - agent: email_summarizer - context: - - reporting_task - - research_task +```bash 배포 생성 +crewai deploy create ``` -## Crew 배포하기 +```bash 상태 및 로그 +crewai deploy status +crewai deploy logs +``` -production 환경에 crew를 배포하는 가장 쉬운 방법은 [CrewAI AMP](http://app.crewai.com)를 통해서입니다. +```bash 코드 변경 후 반영 +crewai deploy push +``` -CLI를 사용하여 [CrewAI AMP](http://app.crewai.com)에 crew를 배포하는 단계별 시연은 이 영상 튜토리얼을 참고하세요. +```bash 배포 목록 또는 삭제 +crewai deploy list +crewai deploy remove +``` + - + + 첫 배포는 보통 **약 1분** 정도 걸립니다. 전체 사전 요건과 웹 UI 절차는 [AMP에 배포](/ko/enterprise/guides/deploy-to-amp)를 참고하세요. + - - CrewAI AOP로 시작하여 몇 번의 클릭만으로 production 환경에 crew를 - 배포하세요. + + AMP 배포 단계별 안내(CLI 및 대시보드). - 오픈 소스 커뮤니티에 참여하여 아이디어를 나누고, 프로젝트를 공유하며, 다른 - CrewAI 개발자들과 소통하세요. + 아이디어를 나누고 프로젝트를 공유하며 다른 CrewAI 개발자와 소통하세요. diff --git a/docs/ko/skills.mdx b/docs/ko/skills.mdx new file mode 100644 index 000000000..0c789c158 --- /dev/null +++ b/docs/ko/skills.mdx @@ -0,0 +1,50 @@ +--- +title: Skills +description: skills.sh의 공식 레지스트리에서 crewaiinc/skills를 설치하세요. Claude Code, Cursor, Codex 등을 위한 Flow, Crew, 문서 연동 스킬. +icon: wand-magic-sparkles +mode: "wide" +--- + +# Skills + +**한 번의 명령으로 코딩 에이전트에 CrewAI 컨텍스트를 제공하세요.** + +CrewAI **Skills**는 **[skills.sh/crewaiinc/skills](https://skills.sh/crewaiinc/skills)**에 게시됩니다. `crewaiinc/skills`의 공식 레지스트리로, 개별 스킬(예: **design-agent**, **getting-started**, **design-task**, **ask-docs**), 설치 수, 감사 정보를 확인할 수 있습니다. Claude Code, Cursor, Codex 같은 코딩 에이전트에게 Flow 구성, Crew 설정, 도구 사용, CrewAI 패턴을 가르칩니다. 아래를 실행하거나 에이전트에 붙여 넣으세요. + +```shell Terminal +npx skills add crewaiinc/skills +``` + +에이전트 워크플로에 스킬 팩이 추가되어 세션마다 프레임워크를 다시 설명하지 않아도 CrewAI 관례를 적용할 수 있습니다. 소스와 이슈는 [GitHub](https://github.com/crewAIInc/skills)에서 관리합니다. + +## 에이전트가 얻는 것 + +- **Flows** — CrewAI 방식의 상태ful 앱, 단계, crew kickoff +- **Crew & 에이전트** — YAML 우선 패턴, 역할, 작업, 위임 +- **도구 & 통합** — 검색, API, 일반적인 CrewAI 도구 연결 +- **프로젝트 구조** — CLI 스캐폴드 및 저장소 관례와 정렬 +- **최신 패턴** — 스킬이 현재 CrewAI 문서 및 권장 사항을 반영 + +## 이 사이트에서 더 알아보기 + + + + CrewAI와 `AGENTS.md`, 코딩 에이전트 워크플로 사용법. + + + 첫 Flow와 crew를 처음부터 끝까지 구축합니다. + + + CrewAI CLI와 Python 패키지를 설치합니다. + + + `crewaiinc/skills` 공식 목록—스킬, 설치 수, 감사. + + + 스킬 팩 소스, 업데이트, 이슈. + + + +### 영상: 코딩 에이전트 스킬과 CrewAI + + + ## Tutorial em Vídeo Assista a este tutorial em vídeo para uma demonstração passo a passo do processo de instalação: @@ -192,12 +200,11 @@ Para equipes e organizações, o CrewAI oferece opções de implantação corpor - Siga nosso guia de início rápido para criar seu primeiro agente CrewAI e - obter experiência prática. + Siga o guia rápido para gerar um Flow, executar um crew com um agente e produzir um relatório. + ## A Arquitetura do CrewAI A arquitetura do CrewAI foi projetada para equilibrar autonomia com controle. @@ -132,7 +140,7 @@ Para qualquer aplicação pronta para produção, **comece com um Flow**. icon="bolt" href="/pt-BR/quickstart" > - Siga nosso guia rápido para criar seu primeiro agente CrewAI e colocar a mão na massa. + Gere um Flow, execute um crew com um agente e produza um relatório ponta a ponta. + +Neste guia você vai **criar um Flow** que define um tópico de pesquisa, executa um **crew com um agente** (um pesquisador com busca na web) e termina com um **relatório em Markdown** no disco. Flows são a forma recomendada de estruturar apps em produção: eles controlam **estado** e **ordem de execução**, enquanto os **agentes** fazem o trabalho dentro da etapa do crew. + +Se ainda não instalou o CrewAI, siga primeiro o [guia de instalação](/pt-BR/installation). + +## Pré-requisitos + +- Ambiente Python e a CLI do CrewAI (veja [instalação](/pt-BR/installation)) +- Um LLM configurado com as chaves corretas — veja [LLMs](/pt-BR/concepts/llms#setting-up-your-llm) +- Uma chave de API do [Serper.dev](https://serper.dev/) (`SERPER_API_KEY`) para busca na web neste tutorial + +## Construa seu primeiro Flow - - Crie um novo projeto de tripulação executando o comando abaixo em seu terminal. - Isso criará um novo diretório chamado `latest-ai-development` com a estrutura básica para sua tripulação. + + No terminal, gere um projeto Flow (o nome da pasta usa sublinhados, ex.: `latest_ai_flow`): + ```shell Terminal - crewai create crew latest-ai-development + crewai create flow latest-ai-flow + cd latest_ai_flow ``` + + Isso cria um app Flow em `src/latest_ai_flow/`, incluindo um crew inicial em `crews/content_crew/` que você substituirá por um crew de pesquisa **com um único agente** nos próximos passos. - - - ```shell Terminal - cd latest_ai_development - ``` - - - - - Você também pode modificar os agentes conforme necessário para atender ao seu caso de uso ou copiar e colar como está para seu projeto. - Qualquer variável interpolada nos seus arquivos `agents.yaml` e `tasks.yaml`, como `{topic}`, será substituída pelo valor da variável no arquivo `main.py`. - + + + Substitua o conteúdo de `src/latest_ai_flow/crews/content_crew/config/agents.yaml` por um único pesquisador. Variáveis como `{topic}` são preenchidas a partir de `crew.kickoff(inputs=...)`. + ```yaml agents.yaml - # src/latest_ai_development/config/agents.yaml + # src/latest_ai_flow/crews/content_crew/config/agents.yaml researcher: role: > - Pesquisador Sênior de Dados em {topic} + Pesquisador(a) Sênior de Dados em {topic} goal: > - Descobrir os avanços mais recentes em {topic} + Descobrir os desenvolvimentos mais recentes em {topic} backstory: > - Você é um pesquisador experiente com talento para descobrir os últimos avanços em {topic}. Conhecido por sua habilidade em encontrar as informações mais relevantes e apresentá-las de forma clara e concisa. - - reporting_analyst: - role: > - Analista de Relatórios em {topic} - goal: > - Criar relatórios detalhados com base na análise de dados e descobertas de pesquisa em {topic} - backstory: > - Você é um analista meticuloso com um olhar atento aos detalhes. É conhecido por sua capacidade de transformar dados complexos em relatórios claros e concisos, facilitando o entendimento e a tomada de decisão por parte dos outros. + Você é um pesquisador experiente que descobre os últimos avanços em {topic}. + Encontra as informações mais relevantes e apresenta tudo com clareza. ``` - + + ```yaml tasks.yaml - # src/latest_ai_development/config/tasks.yaml + # src/latest_ai_flow/crews/content_crew/config/tasks.yaml research_task: description: > - Realize uma pesquisa aprofundada sobre {topic}. - Certifique-se de encontrar informações interessantes e relevantes considerando que o ano atual é 2025. + Faça uma pesquisa aprofundada sobre {topic}. Use busca na web para obter + informações atuais e confiáveis. O ano atual é 2026. expected_output: > - Uma lista com 10 tópicos dos dados mais relevantes sobre {topic} + Um relatório em markdown com seções claras: tendências principais, ferramentas + ou empresas relevantes e implicações. Entre 800 e 1200 palavras. Sem cercas de código em volta do documento inteiro. agent: researcher - - reporting_task: - description: > - Revise o contexto obtido e expanda cada tópico em uma seção completa para um relatório. - Certifique-se de que o relatório seja detalhado e contenha todas as informações relevantes. - expected_output: > - Um relatório completo com os principais tópicos, cada um com uma seção detalhada de informações. - Formate como markdown sem usar '```' - agent: reporting_analyst - output_file: report.md + output_file: output/report.md ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task - from crewai_tools import SerperDevTool - from crewai.agents.agent_builder.base_agent import BaseAgent + + + Aponte o crew gerado para o YAML e anexe `SerperDevTool` ao pesquisador. + + ```python content_crew.py + # src/latest_ai_flow/crews/content_crew/content_crew.py from typing import List + from crewai import Agent, Crew, Process, Task + from crewai.agents.agent_builder.base_agent import BaseAgent + from crewai.project import CrewBase, agent, crew, task + from crewai_tools import SerperDevTool + + @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + class ResearchCrew: + """Crew de pesquisa com um agente, usado dentro do Flow.""" agents: List[BaseAgent] tasks: List[Task] + agents_config = "config/agents.yaml" + tasks_config = "config/tasks.yaml" + @agent def researcher(self) -> Agent: return Agent( - config=self.agents_config['researcher'], # type: ignore[index] + config=self.agents_config["researcher"], # type: ignore[index] verbose=True, - tools=[SerperDevTool()] - ) - - @agent - def reporting_analyst(self) -> Agent: - return Agent( - config=self.agents_config['reporting_analyst'], # type: ignore[index] - verbose=True + tools=[SerperDevTool()], ) @task def research_task(self) -> Task: return Task( - config=self.tasks_config['research_task'], # type: ignore[index] - ) - - @task - def reporting_task(self) -> Task: - return Task( - config=self.tasks_config['reporting_task'], # type: ignore[index] - output_file='output/report.md' # Este é o arquivo que conterá o relatório final. + config=self.tasks_config["research_task"], # type: ignore[index] ) @crew def crew(self) -> Crew: - """Creates the LatestAiDevelopment crew""" return Crew( - agents=self.agents, # Criado automaticamente pelo decorador @agent - tasks=self.tasks, # Criado automaticamente pelo decorador @task + agents=self.agents, + tasks=self.tasks, process=Process.sequential, verbose=True, ) ``` - - ```python crew.py - # src/latest_ai_development/crew.py - from crewai import Agent, Crew, Process, Task - from crewai.project import CrewBase, agent, crew, task, before_kickoff, after_kickoff - from crewai_tools import SerperDevTool - @CrewBase - class LatestAiDevelopmentCrew(): - """LatestAiDevelopment crew""" + + Conecte o crew a um Flow: um passo `@start()` define o tópico no **estado** e um `@listen` executa o crew. O `output_file` da tarefa continua gravando `output/report.md`. - @before_kickoff - def before_kickoff_function(self, inputs): - print(f"Before kickoff function with inputs: {inputs}") - return inputs # You can return the inputs or modify them as needed - - @after_kickoff - def after_kickoff_function(self, result): - print(f"After kickoff function with result: {result}") - return result # You can return the result or modify it as needed - - # ... remaining code - ``` - - - - Por exemplo, você pode passar o input `topic` para sua tripulação para personalizar a pesquisa e o relatório. ```python main.py - #!/usr/bin/env python - # src/latest_ai_development/main.py - import sys - from latest_ai_development.crew import LatestAiDevelopmentCrew + # src/latest_ai_flow/main.py + from pydantic import BaseModel - def run(): - """ - Run the crew. - """ - inputs = { - 'topic': 'AI Agents' - } - LatestAiDevelopmentCrew().crew().kickoff(inputs=inputs) + from crewai.flow import Flow, listen, start + + from latest_ai_flow.crews.content_crew.content_crew import ResearchCrew + + + class ResearchFlowState(BaseModel): + topic: str = "" + report: str = "" + + + class LatestAiFlow(Flow[ResearchFlowState]): + @start() + def prepare_topic(self, crewai_trigger_payload: dict | None = None): + if crewai_trigger_payload: + self.state.topic = crewai_trigger_payload.get("topic", "AI Agents") + else: + self.state.topic = "AI Agents" + print(f"Tópico: {self.state.topic}") + + @listen(prepare_topic) + def run_research(self): + result = ResearchCrew().crew().kickoff(inputs={"topic": self.state.topic}) + self.state.report = result.raw + print("Crew de pesquisa concluído.") + + @listen(run_research) + def summarize(self): + print("Relatório em: output/report.md") + + + def kickoff(): + LatestAiFlow().kickoff() + + + def plot(): + LatestAiFlow().plot() + + + if __name__ == "__main__": + kickoff() ``` - - - Antes de executar sua tripulação, certifique-se de ter as seguintes chaves configuradas como variáveis de ambiente no seu arquivo `.env`: - - Uma chave da API do [Serper.dev](https://serper.dev/): `SERPER_API_KEY=YOUR_KEY_HERE` - - A configuração do modelo de sua escolha, como uma chave de API. Veja o - [guia de configuração do LLM](/pt-BR/concepts/llms#setting-up-your-llm) para aprender como configurar modelos de qualquer provedor. - - - - Trave e instale as dependências utilizando o comando da CLI: - - ```shell Terminal - crewai install - ``` - - - Se quiser instalar pacotes adicionais, faça isso executando: - - ```shell Terminal - uv add - ``` - - - - - Para executar sua tripulação, rode o seguinte comando na raiz do projeto: - - ```bash Terminal - crewai run - ``` - + + Se o nome do pacote não for `latest_ai_flow`, ajuste o import de `ResearchCrew` para o caminho de módulo do seu projeto. + - - Para usuários do CrewAI AMP, você pode criar a mesma tripulação sem escrever código: + + Na raiz do projeto, no arquivo `.env`, defina: -1. Faça login na sua conta CrewAI AMP (crie uma conta gratuita em [app.crewai.com](https://app.crewai.com)) -2. Abra o Crew Studio -3. Digite qual automação deseja construir -4. Crie suas tarefas visualmente e conecte-as em sequência -5. Configure seus inputs e clique em "Download Code" ou "Deploy" - -![Crew Studio Quickstart](/images/enterprise/crew-studio-interface.png) - - - Comece sua conta gratuita no CrewAI AMP - + - `SERPER_API_KEY` — obtida em [Serper.dev](https://serper.dev/) + - As chaves do provedor de modelo conforme necessário — veja [configuração de LLM](/pt-BR/concepts/llms#setting-up-your-llm) - - Você verá a saída no console e o arquivo `report.md` deve ser criado na raiz do seu projeto com o relatório final. -Veja um exemplo de como o relatório deve ser: + + + ```shell Terminal + crewai install + crewai run + ``` + + + O `crewai run` executa o ponto de entrada do Flow definido no projeto (o mesmo comando dos crews; o tipo do projeto é `"flow"` no `pyproject.toml`). + + + + Você deve ver logs do Flow e do crew. Abra **`output/report.md`** para o relatório gerado (trecho): ```markdown output/report.md - # Relatório Abrangente sobre a Ascensão e o Impacto dos Agentes de IA em 2025 + # Agentes de IA em 2026: panorama e tendências - ## 1. Introduction to AI Agents - In 2025, Artificial Intelligence (AI) agents are at the forefront of innovation across various industries. As intelligent systems that can perform tasks typically requiring human cognition, AI agents are paving the way for significant advancements in operational efficiency, decision-making, and overall productivity within sectors like Human Resources (HR) and Finance. This report aims to detail the rise of AI agents, their frameworks, applications, and potential implications on the workforce. + ## Resumo executivo + … - ## 2. Benefits of AI Agents - AI agents bring numerous advantages that are transforming traditional work environments. Key benefits include: + ## Principais tendências + - **Uso de ferramentas e orquestração** — … + - **Adoção empresarial** — … - - **Task Automation**: AI agents can carry out repetitive tasks such as data entry, scheduling, and payroll processing without human intervention, greatly reducing the time and resources spent on these activities. - - **Improved Efficiency**: By quickly processing large datasets and performing analyses that would take humans significantly longer, AI agents enhance operational efficiency. This allows teams to focus on strategic tasks that require higher-level thinking. - - **Enhanced Decision-Making**: AI agents can analyze trends and patterns in data, provide insights, and even suggest actions, helping stakeholders make informed decisions based on factual data rather than intuition alone. - - ## 3. Popular AI Agent Frameworks - Several frameworks have emerged to facilitate the development of AI agents, each with its own unique features and capabilities. Some of the most popular frameworks include: - - - **Autogen**: A framework designed to streamline the development of AI agents through automation of code generation. - - **Semantic Kernel**: Focuses on natural language processing and understanding, enabling agents to comprehend user intentions better. - - **Promptflow**: Provides tools for developers to create conversational agents that can navigate complex interactions seamlessly. - - **Langchain**: Specializes in leveraging various APIs to ensure agents can access and utilize external data effectively. - - **CrewAI**: Aimed at collaborative environments, CrewAI strengthens teamwork by facilitating communication through AI-driven insights. - - **MemGPT**: Combines memory-optimized architectures with generative capabilities, allowing for more personalized interactions with users. - - These frameworks empower developers to build versatile and intelligent agents that can engage users, perform advanced analytics, and execute various tasks aligned with organizational goals. - - ## 4. AI Agents in Human Resources - AI agents are revolutionizing HR practices by automating and optimizing key functions: - - - **Recruiting**: AI agents can screen resumes, schedule interviews, and even conduct initial assessments, thus accelerating the hiring process while minimizing biases. - - **Succession Planning**: AI systems analyze employee performance data and potential, helping organizations identify future leaders and plan appropriate training. - - **Employee Engagement**: Chatbots powered by AI can facilitate feedback loops between employees and management, promoting an open culture and addressing concerns promptly. - - As AI continues to evolve, HR departments leveraging these agents can realize substantial improvements in both efficiency and employee satisfaction. - - ## 5. AI Agents in Finance - The finance sector is seeing extensive integration of AI agents that enhance financial practices: - - - **Expense Tracking**: Automated systems manage and monitor expenses, flagging anomalies and offering recommendations based on spending patterns. - - **Risk Assessment**: AI models assess credit risk and uncover potential fraud by analyzing transaction data and behavioral patterns. - - **Investment Decisions**: AI agents provide stock predictions and analytics based on historical data and current market conditions, empowering investors with informative insights. - - The incorporation of AI agents into finance is fostering a more responsive and risk-aware financial landscape. - - ## 6. Market Trends and Investments - The growth of AI agents has attracted significant investment, especially amidst the rising popularity of chatbots and generative AI technologies. Companies and entrepreneurs are eager to explore the potential of these systems, recognizing their ability to streamline operations and improve customer engagement. - - Conversely, corporations like Microsoft are taking strides to integrate AI agents into their product offerings, with enhancements to their Copilot 365 applications. This strategic move emphasizes the importance of AI literacy in the modern workplace and indicates the stabilizing of AI agents as essential business tools. - - ## 7. Future Predictions and Implications - Experts predict that AI agents will transform essential aspects of work life. As we look toward the future, several anticipated changes include: - - - Enhanced integration of AI agents across all business functions, creating interconnected systems that leverage data from various departmental silos for comprehensive decision-making. - - Continued advancement of AI technologies, resulting in smarter, more adaptable agents capable of learning and evolving from user interactions. - - Increased regulatory scrutiny to ensure ethical use, especially concerning data privacy and employee surveillance as AI agents become more prevalent. - - To stay competitive and harness the full potential of AI agents, organizations must remain vigilant about latest developments in AI technology and consider continuous learning and adaptation in their strategic planning. - - ## 8. Conclusion - The emergence of AI agents is undeniably reshaping the workplace landscape in 5. With their ability to automate tasks, enhance efficiency, and improve decision-making, AI agents are critical in driving operational success. Organizations must embrace and adapt to AI developments to thrive in an increasingly digital business environment. + ## Implicações + … ``` - + + O arquivo real será mais longo e refletirá resultados de busca ao vivo. +## Como isso se encaixa + +1. **Flow** — `LatestAiFlow` executa `prepare_topic`, depois `run_research`, depois `summarize`. O estado (`topic`, `report`) fica no Flow. +2. **Crew** — `ResearchCrew` executa uma tarefa com um agente: o pesquisador usa **Serper** na web e escreve o relatório. +3. **Artefato** — O `output_file` da tarefa grava o relatório em `output/report.md`. + +Para ir além em Flows (roteamento, persistência, human-in-the-loop), veja [Construa seu primeiro Flow](/pt-BR/guides/flows/first-flow) e [Flows](/pt-BR/concepts/flows). Para crews sem Flow, veja [Crews](/pt-BR/concepts/crews). Para um único `Agent` com `kickoff()` sem tarefas, veja [Agents](/pt-BR/concepts/agents#direct-agent-interaction-with-kickoff). + -Parabéns! - -Você configurou seu projeto de tripulação com sucesso e está pronto para começar a construir seus próprios fluxos de trabalho baseados em agentes! - +Você tem um Flow ponta a ponta com um crew de agente e um relatório salvo — uma base sólida para novas etapas, crews ou ferramentas. -### Observação sobre Consistência nos Nomes +### Consistência de nomes -Os nomes utilizados nos seus arquivos YAML (`agents.yaml` e `tasks.yaml`) devem corresponder aos nomes dos métodos no seu código Python. -Por exemplo, você pode referenciar o agente para tarefas específicas a partir do arquivo `tasks.yaml`. -Essa consistência de nomes permite que a CrewAI conecte automaticamente suas configurações ao seu código; caso contrário, sua tarefa não reconhecerá a referência corretamente. +As chaves do YAML (`researcher`, `research_task`) devem coincidir com os nomes dos métodos na classe `@CrewBase`. Veja [Crews](/pt-BR/concepts/crews) para o padrão completo com decoradores. -#### Exemplos de Referências +## Implantação - - Observe como usamos o mesmo nome para o agente no arquivo `agents.yaml` - (`email_summarizer`) e no método do arquivo `crew.py` (`email_summarizer`). - +Envie seu Flow para o **[CrewAI AMP](https://app.crewai.com)** quando rodar localmente e o projeto estiver em um repositório **GitHub**. Na raiz do projeto: -```yaml agents.yaml -email_summarizer: - role: > - Email Summarizer - goal: > - Summarize emails into a concise and clear summary - backstory: > - You will create a 5 bullet point summary of the report - llm: provider/model-id # Add your choice of model here + +```bash Autenticar +crewai login ``` - - Observe como usamos o mesmo nome para a tarefa no arquivo `tasks.yaml` - (`email_summarizer_task`) e no método no arquivo `crew.py` - (`email_summarizer_task`). - - -```yaml tasks.yaml -email_summarizer_task: - description: > - Summarize the email into a 5 bullet point summary - expected_output: > - A 5 bullet point summary of the email - agent: email_summarizer - context: - - reporting_task - - research_task +```bash Criar implantação +crewai deploy create ``` -## Fazendo o Deploy da Sua Tripulação +```bash Status e logs +crewai deploy status +crewai deploy logs +``` -A forma mais fácil de fazer deploy da sua tripulação em produção é através da [CrewAI AMP](http://app.crewai.com). +```bash Enviar atualizações após mudanças no código +crewai deploy push +``` -Assista a este vídeo tutorial para uma demonstração detalhada de como fazer deploy da sua tripulação na [CrewAI AMP](http://app.crewai.com) usando a CLI. +```bash Listar ou remover implantações +crewai deploy list +crewai deploy remove +``` + - + + A primeira implantação costuma levar **cerca de 1 minuto**. Pré-requisitos completos e fluxo na interface web estão em [Implantar no AMP](/pt-BR/enterprise/guides/deploy-to-amp). + - - Comece com o CrewAI AMP e faça o deploy da sua tripulação em ambiente de - produção com apenas alguns cliques. + + AMP passo a passo (CLI e painel). - Participe da nossa comunidade open source para discutir ideias, compartilhar - seus projetos e conectar-se com outros desenvolvedores CrewAI. + Troque ideias, compartilhe projetos e conecte-se com outros desenvolvedores CrewAI. diff --git a/docs/pt-BR/skills.mdx b/docs/pt-BR/skills.mdx new file mode 100644 index 000000000..acd372d3f --- /dev/null +++ b/docs/pt-BR/skills.mdx @@ -0,0 +1,50 @@ +--- +title: Skills +description: Instale crewaiinc/skills pelo registro oficial em skills.sh—Flows, Crews e agentes alinhados à documentação para Claude Code, Cursor, Codex e outros. +icon: wand-magic-sparkles +mode: "wide" +--- + +# Skills + +**Dê ao seu agente de código o contexto do CrewAI em um comando.** + +As **Skills** do CrewAI são publicadas em **[skills.sh/crewaiinc/skills](https://skills.sh/crewaiinc/skills)**—o registro oficial de `crewaiinc/skills`, com cada skill (por exemplo **design-agent**, **getting-started**, **design-task** e **ask-docs**), estatísticas de instalação e auditorias. Ensinam agentes de código—como Claude Code, Cursor e Codex—a estruturar Flows, configurar Crews, usar ferramentas e seguir os padrões do CrewAI. Execute o comando abaixo (ou cole no seu agente). + +```shell Terminal +npx skills add crewaiinc/skills +``` + +Isso adiciona o pacote de skills ao fluxo do seu agente para aplicar convenções do CrewAI sem precisar reexplicar o framework a cada sessão. Código-fonte e issues ficam no [GitHub](https://github.com/crewAIInc/skills). + +## O que seu agente ganha + +- **Flows** — apps com estado, passos e kickoffs de crew no estilo CrewAI +- **Crews e agentes** — padrões YAML-first, papéis, tarefas e delegação +- **Ferramentas e integrações** — conectar agentes a busca, APIs e ferramentas comuns +- **Layout de projeto** — alinhar com scaffolds da CLI e convenções do repositório +- **Padrões atualizados** — skills acompanham a documentação e as práticas recomendadas + +## Saiba mais neste site + + + + Como usar `AGENTS.md` e fluxos de agente de código com o CrewAI. + + + Construa seu primeiro Flow e crew ponta a ponta. + + + Instale a CLI e o pacote Python do CrewAI. + + + Listagem oficial de `crewaiinc/skills`—skills, instalações e auditorias. + + + Fonte, atualizações e issues do pacote de skills. + + + +### Vídeo: CrewAI com coding agent skills + +