Skip to content

docs(integrations): add agent framework integration guides for LlamaIndex, CrewAI, AutoGen, LangGraph - #66

Open
kindmeetsy wants to merge 1 commit into
afx-team:mainfrom
kindmeetsy:main
Open

docs(integrations): add agent framework integration guides for LlamaIndex, CrewAI, AutoGen, LangGraph#66
kindmeetsy wants to merge 1 commit into
afx-team:mainfrom
kindmeetsy:main

Conversation

@kindmeetsy

@kindmeetsy kindmeetsy commented Aug 11, 2026

Copy link
Copy Markdown

What

Adds copy-paste integration guides for four Python agent frameworks (LlamaIndex, CrewAI, AutoGen, LangGraph) using both MCP tools and REST API
surfaces.

Changes

  • repo_pages/guide/agent-frameworks.md — EN docs page with ~10-line snippets per framework
  • repo_pages/zh/guide/agent-frameworks.md — zh mirror (per CLAUDE.md per-language parity rule)
  • repo_pages/.vitepress/config.mts — sidebar entry for EN + zh
  • README.md — link in integrations section
  • examples/README.md — updated pick-your-starting-point section

Acceptance criteria

  • New EN docs page under repo_pages/guide/ with copy-paste snippet (~10 lines each) for LlamaIndex, CrewAI, AutoGen, and LangGraph
  • zh mirror page under repo_pages/zh/guide/ with the same four snippets
  • Each snippet is runnable against a local hebb service on http://localhost:8321 and uses only existing surfaces (MCP tool names
    search_memory/write_memory, or REST POST /api/v1/search and POST /api/v1/memories)
  • New page added to the VitePress sidebar (repo_pages/.vitepress/config.mts) for both EN and zh
  • Linked from README.md (integrations section) and examples/README.md
  • No new runtime library code introduced (documentation-only)

Closes #29

Summary by CodeRabbit

  • Documentation
    • Added English and Chinese guides for integrating Hebb Mind with LlamaIndex, CrewAI, AutoGen, and LangGraph.
    • Documented REST API and MCP connection options, setup requirements, usage examples, and error handling.
    • Updated installation guidance, examples navigation, and guide sidebars to link to the new integration documentation.

…ndex, CrewAI, AutoGen, LangGraph

- Add EN docs page at repo_pages/guide/agent-frameworks.md
- Add zh mirror at repo_pages/zh/guide/agent-frameworks.md
- Update VitePress sidebar config for both EN and zh
- Link from README.md integrations section
- Link from examples/README.md

Each framework has ~10-line copy-paste snippets using either REST API
or MCP tools, all runnable against localhost:8321.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added bilingual Agent Framework Integrations guides for LlamaIndex, CrewAI, AutoGen, and LangGraph. The guides document REST API and MCP usage, framework setup examples, prerequisites, supported endpoints, and navigation links.

Changes

Agent framework documentation

Layer / File(s) Summary
Guide foundation and navigation
repo_pages/guide/agent-frameworks.md, repo_pages/zh/guide/agent-frameworks.md, README.md, examples/README.md, repo_pages/.vitepress/config.mts
Added guide metadata, prerequisites, entry-point links, table-of-contents updates, and localized sidebar navigation.
English framework recipes
repo_pages/guide/agent-frameworks.md
Added LlamaIndex, CrewAI, AutoGen, and LangGraph examples using REST memory operations and MCP tools.
Chinese framework recipes
repo_pages/zh/guide/agent-frameworks.md
Added Chinese equivalents of the four framework examples, endpoint documentation, MCP tool documentation, and framework comparison content.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: afx-team

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the documentation change and all four supported agent frameworks.
Linked Issues check ✅ Passed The PR satisfies issue #29 by adding English and Chinese guides, sidebar links, README links, existing-surface snippets, and no runtime code.
Out of Scope Changes check ✅ Passed The changes are documentation-only and directly support the linked integration-guide objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kindmeetsy

Copy link
Copy Markdown
Author

#29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/README.md`:
- Line 19: Update the starting-point picker entry in examples/README.md to
reference ../repo_pages/guide/agent-frameworks.md, matching the correct guide
location and the table’s existing relative path.

In `@repo_pages/guide/agent-frameworks.md`:
- Around line 14-27: Update the prerequisite sections in
repo_pages/guide/agent-frameworks.md (lines 14-27) and
repo_pages/zh/guide/agent-frameworks.md (lines 11-24) so both are runnable:
document installation of the framework and MCP adapter packages required by the
snippets, and include the necessary LLM configuration and model setup commands.
Keep the English and Chinese instructions equivalent and preserve the existing
Hebb Mind CLI and Python SDK setup.
- Around line 128-143: Replace the invalid subprocess-based HebbMCPTrait
examples in repo_pages/guide/agent-frameworks.md (lines 128-143) and
repo_pages/zh/guide/agent-frameworks.md (lines 125-141) with a supported MCP
client/adapter integration for the stdio server. In both pages, show the MCP
tool attached to an Agent and Crew, and include transport-error and timeout
handling; remove the nonexistent hebb-mcp call subcommand usage.
- Around line 150-179: Update both MCP examples in
repo_pages/guide/agent-frameworks.md lines 150-179 and
repo_pages/zh/guide/agent-frameworks.md lines 145-176 to the current AutoGen
AgentChat API: import agents from autogen_agentchat, use StdioServerParams and
McpWorkbench, pass workbench=workbench to AssistantAgent, configure the current
model_client, and invoke assistant.run(...). Remove the legacy McpSession,
llm_config, and extra_args={"tools": tools} flow in both files.
- Around line 33-55: Update the LlamaIndex MCP examples in
repo_pages/guide/agent-frameworks.md (lines 33-55) and
repo_pages/zh/guide/agent-frameworks.md (lines 28-52) to use stdio transport
with the documented BasicMCPClient and McpToolSpec flow. Replace
MCPRemoteToolProvider and the localhost URL with the absolute hebb-mcp command
in both guides, preserving the surrounding agent setup and example intent.
- Around line 245-259: Update both MCP examples in
repo_pages/guide/agent-frameworks.md lines 245-259 and
repo_pages/zh/guide/agent-frameworks.md lines 242-256: import create_react_agent
from langgraph.prebuilt, add "transport": "stdio" and "args": [] to the server
configuration, and move client.get_tools() into an async main() function invoked
with asyncio.run(main()).
- Around line 121-125: Add the required goal field to Agent and expected_output
field to Task in both guide snippets. Update
repo_pages/guide/agent-frameworks.md lines 121-125 with matching English values,
and repo_pages/zh/guide/agent-frameworks.md lines 118-122 with corresponding
Chinese values.

In `@repo_pages/zh/guide/agent-frameworks.md`:
- Around line 5-7: 将文档标题和正文中的通用英文术语 Agent 统一替换为“智能体”,并将小节标题中的 subprocess
替换为“子进程”。保留 LlamaIndex、CrewAI、AutoGen、LangGraph、MCP、REST API 及代码标识符不变。
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ab1e95ff-eccb-4279-aca5-dd04d04b38b0

📥 Commits

Reviewing files that changed from the base of the PR and between 36ce983 and 0c7f1e0.

📒 Files selected for processing (5)
  • README.md
  • examples/README.md
  • repo_pages/.vitepress/config.mts
  • repo_pages/guide/agent-frameworks.md
  • repo_pages/zh/guide/agent-frameworks.md

Comment thread examples/README.md
Want your AI coding agent to use Hebb Mind? ──→ 03_mcp_quickstart.md
Want to see (or reproduce) benchmark numbers? ──→ 04_benchmarks_locomo.md
Want to plug Hebb Mind into LangChain? ──→ 05_langchain_adapter.py (WIP)
Want to plug Hebb Mind into other frameworks? ──→ docs/guide/agent-frameworks.md (LlamaIndex, CrewAI, AutoGen, LangGraph)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the guide path in the starting-point picker.

examples/README.md points to docs/guide/agent-frameworks.md, but the added guide is under repo_pages/guide/agent-frameworks.md. The table below already uses the correct relative path. Update the picker to use ../repo_pages/guide/agent-frameworks.md or the published guide path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/README.md` at line 19, Update the starting-point picker entry in
examples/README.md to reference ../repo_pages/guide/agent-frameworks.md,
matching the correct guide location and the table’s existing relative path.

Comment on lines +14 to +27
## Prerequisites

```bash
pipx install hebb-mind
hebb setup # downloads the embedding model
hebb service install # registers the background service
```

Or use the Python SDK directly (`pip install hebb-mind`):

```python
from hebb import HebbMind
hc = HebbMind() # in-process, no HTTP server needed
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make both prerequisite sections runnable.

Both pages install only Hebb Mind, while the snippets require framework packages, MCP adapters, and LLM configuration.

  • repo_pages/guide/agent-frameworks.md#L14-L27: add the required package and model setup instructions.
  • repo_pages/zh/guide/agent-frameworks.md#L11-L24: add the matching Chinese instructions.
📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L14-L27 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L11-L24
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 14 - 27, Update the
prerequisite sections in repo_pages/guide/agent-frameworks.md (lines 14-27) and
repo_pages/zh/guide/agent-frameworks.md (lines 11-24) so both are runnable:
document installation of the framework and MCP adapter packages required by the
snippets, and include the necessary LLM configuration and model setup commands.
Keep the English and Chinese instructions equivalent and preserve the existing
Hebb Mind CLI and Python SDK setup.

Comment on lines +33 to +55
LlamaIndex supports MCP tools natively via `llama-index-tools-mcp`. Alternatively, use the REST API with a simple wrapper.

### Using MCP Tools (recommended for LlamaIndex 2024+)

```python
from llama_index.core.agent import FunctionCallingAgentWorker
from llama_index.tools.mcp import MCPRemoteToolProvider
import asyncio

async def main():
# Connect to the local hebb-mcp server
provider = MCPRemoteToolProvider(
name="hebb",
server_url="http://localhost:8321",
timeout=30,
)
tools = await provider.get_tools()
worker = FunctionCallingAgentWorker(tools=tools, verbose=True)
agent = worker.as_agent()
agent.chat("What do I know about the user's UI preferences?")

asyncio.run(main())
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- English guide ---'
cat -n repo_pages/guide/agent-frameworks.md | sed -n '1,90p'
printf '%s\n' '--- Chinese guide ---'
cat -n repo_pages/zh/guide/agent-frameworks.md | sed -n '1,85p'
printf '%s\n' '--- Related MCP references ---'
rg -n -C 3 'MCPRemoteToolProvider|BasicMCPClient|McpToolSpec|hebb-mcp|8321|llama-index' repo_pages README.md reports 2>/dev/null || true

Repository: afx-team/hebb-mind

Length of output: 50377


🌐 Web query:

LlamaIndex Python MCP BasicMCPClient McpToolSpec MCPRemoteToolProvider documented API

💡 Result:

LlamaIndex supports Model Context Protocol (MCP) integration through the llama-index-tools-mcp package [1][2]. The key components for this integration are BasicMCPClient and McpToolSpec [1][2]. BasicMCPClient The BasicMCPClient acts as the primary interface for connecting to MCP servers [2][3]. It supports multiple transport methods: - Server-Sent Events (SSE): BasicMCPClient("https://example.com/sse") [1][2] - Streamable HTTP: BasicMCPClient("https://example.com/mcp") [1][2] - Local Process (stdio): BasicMCPClient("python", args=["server.py"]) [1][2] Beyond tool execution, it provides methods to list and call tools, list and read resources, and list and use prompts [2][4]. It also supports OAuth authentication via the BasicMCPClient.with_oauth class method [2][3]. McpToolSpec McpToolSpec is used to convert tools exposed by an MCP server into LlamaIndex FunctionTool objects [5][1]. Usage workflow: 1. Initialize a BasicMCPClient pointing to your MCP server [1][2]. 2. Pass the client instance to McpToolSpec [1][2]. 3. Use to_tool_list (synchronous) or to_tool_list_async (asynchronous) to retrieve the tools for use in LlamaIndex agents [2][6]. Example: from llama_index.tools.mcp import BasicMCPClient, McpToolSpec # Connect to the server mcp_client = BasicMCPClient("http://127.0.0.1:8000/sse") # Create the tool spec mcp_tool_spec = McpToolSpec(client=mcp_client) # Convert to LlamaIndex tools tools = await mcp_tool_spec.to_tool_list_async Regarding "MCPRemoteToolProvider," it is not a primary component documented in the standard usage guides for this integration; the integration relies on BasicMCPClient for remote connections and McpToolSpec for abstraction [1][2].

Citations:


🌐 Web query:

site:developers.llamaindex.ai/python/framework/module_guides/mcp/llamaindex_mcp BasicMCPClient McpToolSpec

💡 Result:

BasicMCPClient and McpToolSpec are components within the llama-index-tools-mcp package, designed to facilitate the integration of Model Context Protocol (MCP) servers into LlamaIndex workflows [1]. BasicMCPClient serves as the client interface that handles the connection to an MCP server [1]. It supports various transport methods, including Server-Sent Events (SSE), standard HTTP, and local process execution [1]. McpToolSpec acts as a bridge or specification layer that takes a configured BasicMCPClient instance and converts the tools exposed by the MCP server into a format compatible with LlamaIndex [1]. By initializing an McpToolSpec with the client, developers can retrieve a list of tools using methods such as to_tool_list_async, enabling the LlamaIndex framework to interact with the external MCP tools seamlessly [1]. Example usage: from llama_index.tools.mcp import BasicMCPClient, McpToolSpec mcp_client = BasicMCPClient("http://127.0.0.1:8000/sse") mcp_tool_spec = McpToolSpec(client=mcp_client) tools = await mcp_tool_spec.to_tool_list_async

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- MCP implementation and packaging ---'
rg -n -C 4 'MCPRemoteToolProvider|BasicMCPClient|McpToolSpec|hebb-mcp|FastMCP|streamable|SSE|stdio|mcp' \
  --glob '*.py' --glob 'pyproject.toml' --glob 'README.md' --glob '*.md' . \
  | head -n 500
printf '%s\n' '--- MCP-related files ---'
git ls-files | rg '(^|/)(mcp|.*mcp.*|pyproject.toml)$|agent-frameworks'
printf '%s\n' '--- MCP entry points and server declarations ---'
rg -n -C 8 'hebb-mcp|mcp_server|FastMCP|`@mcp`|MCP' pyproject.toml setup.cfg setup.py src app hebb 2>/dev/null || true

Repository: afx-team/hebb-mind

Length of output: 50377


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import ast
import re

files = [p for p in Path(".").rglob("*") if p.is_file() and (
    p.name in {"pyproject.toml", "setup.py", "setup.cfg"} or
    "mcp" in p.name.lower()
)]
for path in sorted(files):
    text = path.read_text(errors="replace")
    hits = []
    for needle in ("hebb-mcp", "FastMCP", "MCPRemoteToolProvider",
                   "BasicMCPClient", "McpToolSpec", "stdio", "sse",
                   "streamable", "8321"):
        if needle.lower() in text.lower():
            hits.append(needle)
    if hits:
        print(f"{path}: {', '.join(hits)}")
        for i, line in enumerate(text.splitlines(), 1):
            if re.search(r"hebb-mcp|FastMCP|MCPRemoteToolProvider|BasicMCPClient|McpToolSpec|stdio|sse|streamable|8321", line, re.I):
                print(f"  {i}: {line.strip()}")
PY

Repository: afx-team/hebb-mind

Length of output: 4385


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re

files = [p for p in Path(".").rglob("*") if p.is_file() and (
    p.name in {"pyproject.toml", "setup.py", "setup.cfg"} or
    "mcp" in p.name.lower()
)]
for path in sorted(files):
    text = path.read_text(errors="replace")
    if re.search(
        r"hebb-mcp|FastMCP|MCPRemoteToolProvider|BasicMCPClient|McpToolSpec|"
        r"stdio|sse|streamable|8321",
        text,
        re.I,
    ):
        print(f"--- {path} ---")
        for i, line in enumerate(text.splitlines(), 1):
            if re.search(
                r"hebb-mcp|FastMCP|MCPRemoteToolProvider|BasicMCPClient|McpToolSpec|"
                r"stdio|sse|streamable|8321",
                line,
                re.I,
            ):
                print(f"{i}: {line.strip()}")
PY

Repository: afx-team/hebb-mind

Length of output: 4241


Use the stdio MCP transport in both LlamaIndex guides. The Hebb MCP server exposes hebb-mcp over stdio, while http://localhost:8321 is the REST service and is not an MCP HTTP endpoint. Replace MCPRemoteToolProvider with the documented BasicMCPClient and McpToolSpec flow, using the absolute hebb-mcp command in both files.

📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L33-L55 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L28-L52
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 33 - 55, Update the
LlamaIndex MCP examples in repo_pages/guide/agent-frameworks.md (lines 33-55)
and repo_pages/zh/guide/agent-frameworks.md (lines 28-52) to use stdio transport
with the documented BasicMCPClient and McpToolSpec flow. Replace
MCPRemoteToolProvider and the localhost URL with the absolute hebb-mcp command
in both guides, preserving the surrounding agent setup and example intent.

Comment on lines +121 to +125
# In your crew setup
agent = Agent(role="Researcher", backstory="You have access to long-term memory.", tools=[MemorySearchTool()])
task = Task(description="What did the user say about their preferences?")
crew = Crew(agents=[agent], tasks=[task])
crew.kickoff()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- affected files ---'
git ls-files 'repo_pages/guide/agent-frameworks.md' 'repo_pages/zh/guide/agent-frameworks.md'
printf '%s\n' '--- English section ---'
sed -n '95,145p' repo_pages/guide/agent-frameworks.md
printf '%s\n' '--- Chinese section ---'
sed -n '92,140p' repo_pages/zh/guide/agent-frameworks.md
printf '%s\n' '--- CrewAI references and metadata ---'
rg -n -S 'CrewAI|crewai|MemorySearchTool|expected_output|backstory=.*memory|长期记忆' \
  --glob '!node_modules' --glob '!dist' --glob '!build' .

Repository: afx-team/hebb-mind

Length of output: 7674


🏁 Script executed:

#!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT

curl -fsSL https://raw.githubusercontent.com/crewAIInc/crewAI/main/lib/crewai/src/crewai/task.py \
  -o "$tmpdir/task.py"
printf '%s\n' '--- Task declarations and validation ---'
rg -n -C 4 'class Task|expected_output|model_config|field_validator|model_validator' "$tmpdir/task.py"

printf '%s\n' '--- Agent source candidates ---'
curl -fsSL https://api.github.com/repos/crewAIInc/crewAI/git/trees/main?recursive=1 |
  jq -r '.tree[] | select(.path | test("agent.*\\.py$|agents/.+\\.py$")) | .path' |
  head -80

Repository: afx-team/hebb-mind

Length of output: 10325


🏁 Script executed:

#!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT

curl -fsSL https://raw.githubusercontent.com/crewAIInc/crewAI/main/lib/crewai/src/crewai/task.py \
  -o "$tmpdir/task.py"
printf '%s\n' '--- Task declarations and validation ---'
rg -n -C 4 'class Task|expected_output|model_config|field_validator|model_validator' "$tmpdir/task.py"

printf '%s\n' '--- Agent source candidates ---'
curl -fsSL 'https://api.github.com/repos/crewAIInc/crewAI/git/trees/main?recursive=1' |
  jq -r '.tree[] | select(.path | test("agent.*\\.py$|agents/.+\\.py$")) | .path' |
  head -80

Repository: afx-team/hebb-mind

Length of output: 10325


🌐 Web query:

CrewAI current main source Agent class goal Field required crewAIInc crewAI

💡 Result:

In the CrewAI framework, the 'goal' field is a required attribute for the Agent class [1][2]. The framework's internal validation logic ensures that the 'role', 'goal', and 'backstory' fields are provided during agent initialization [1][2]. Specifically, the BaseAgent class uses a Pydantic model validator that raises a ValueError if these three fields are not set, either directly through the constructor or via a configuration object [1][2]. Consequently, 'goal' is essential for defining the agent's individual objective and guiding its decision-making process within the crew [3][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT

curl -fsSL https://raw.githubusercontent.com/crewAIInc/crewAI/main/lib/crewai/src/crewai/agents/agent_builder/base_agent.py \
  -o "$tmpdir/base_agent.py"
curl -fsSL https://raw.githubusercontent.com/crewAIInc/crewAI/main/lib/crewai/src/crewai/task.py \
  -o "$tmpdir/task.py"

python3 - "$tmpdir/base_agent.py" "$tmpdir/task.py" <<'PY'
import re
import sys
from pathlib import Path

agent_source = Path(sys.argv[1]).read_text()
task_source = Path(sys.argv[2]).read_text()

checks = {
    "Agent.goal declaration": re.search(
        r"^\s*goal:\s*str\s*=\s*Field\(\s*$", agent_source, re.MULTILINE
    ),
    "Agent required-field validation": re.search(
        r"role.*goal.*backstory|goal.*must be provided|goal.*required",
        agent_source,
        re.IGNORECASE | re.DOTALL,
    ),
    "Task.expected_output declaration": re.search(
        r"^\s*expected_output:\s*str\s*=\s*Field\(\s*$", task_source, re.MULTILINE
    ),
    "Task required-field validation": re.search(
        r"expected_output must be provided",
        task_source,
    ),
}
for name, match in checks.items():
    print(f"{name}: {'present' if match else 'missing'}")
    if not match:
        raise SystemExit(1)
PY

printf '%s\n' '--- Agent relevant lines ---'
rg -n -C 4 '^\s*(role|goal|backstory):|must be provided|validate_required_fields' "$tmpdir/base_agent.py"

Repository: afx-team/hebb-mind

Length of output: 188


🏁 Script executed:

#!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT

curl -fsSL https://raw.githubusercontent.com/crewAIInc/crewAI/main/lib/crewai/src/crewai/agents/agent_builder/base_agent.py \
  -o "$tmpdir/base_agent.py"

printf '%s\n' '--- Agent field and validator context ---'
rg -n -C 8 'goal|backstory|role|validate_required_fields|must be provided' "$tmpdir/base_agent.py" | head -160

printf '%s\n' '--- Tolerant source checks ---'
python3 - "$tmpdir/base_agent.py" <<'PY'
import re
import sys
from pathlib import Path

source = Path(sys.argv[1]).read_text()
patterns = {
    "goal field": r"(?m)^\s*goal\s*:\s*[^=\n]+\s*=\s*Field\b",
    "role field": r"(?m)^\s*role\s*:\s*[^=\n]+\s*=\s*Field\b",
    "backstory field": r"(?m)^\s*backstory\s*:\s*[^=\n]+\s*=\s*Field\b",
    "required-field validator": r"(?is)(?:role.*goal.*backstory|goal.*backstory.*role).{0,1000}(?:must be provided|required)",
}
for name, pattern in patterns.items():
    found = bool(re.search(pattern, source))
    print(f"{name}: {'present' if found else 'missing'}")
PY

Repository: afx-team/hebb-mind

Length of output: 7002


Add goal to Agent and expected_output to Task in both guides.

CrewAI requires both fields, so each example fails during object construction. Use matching English and Chinese values in the respective snippets.

📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L121-L125 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L118-L122
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 121 - 125, Add the
required goal field to Agent and expected_output field to Task in both guide
snippets. Update repo_pages/guide/agent-frameworks.md lines 121-125 with
matching English values, and repo_pages/zh/guide/agent-frameworks.md lines
118-122 with corresponding Chinese values.

Comment on lines +128 to +143
### Using MCP Tools via subprocess

```python
import subprocess, json
from crewai.tools import BaseTool

class HebbMCPTrait(BaseTool):
name: str = "Hebb Memory"
description: str = "Write or search memory via hebb-mcp"

def _run(self, action: str, **kwargs) -> str:
result = subprocess.run(
["hebb-mcp", "call", action, json.dumps(kwargs)],
capture_output=True, text=True
)
return result.stdout

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- target files ---'
git ls-files 'repo_pages/guide/agent-frameworks.md' 'repo_pages/zh/guide/agent-frameworks.md'
printf '%s\n' '--- relevant excerpts ---'
sed -n '110,155p' repo_pages/guide/agent-frameworks.md
sed -n '110,155p' repo_pages/zh/guide/agent-frameworks.md
printf '%s\n' '--- related repository references ---'
rg -n --glob '!node_modules' --glob '!dist' --glob '!build' \
  'HebbMCPTrait|hebb-mcp|MCP|crewai|subprocess\.run' .
printf '%s\n' '--- repository metadata and likely dependency files ---'
git ls-files | rg '(^|/)(README|pyproject\.toml|requirements[^/]*|package\.json|[^/]*lock|Dockerfile|compose[^/]*|\.github/)' | head -200

Repository: afx-team/hebb-mind

Length of output: 50376


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- CrewAI sections ---'
sed -n '85,150p' repo_pages/guide/agent-frameworks.md
sed -n '82,145p' repo_pages/zh/guide/agent-frameworks.md
printf '%s\n' '--- MCP entry point and server main ---'
sed -n '55,75p' pyproject.toml
sed -n '1,235p' src/hebb/mcp/server.py
printf '%s\n' '--- CLI MCP documentation ---'
sed -n '185,205p' repo_pages/guide/mcp-integration.md
sed -n '135,148p' repo_pages/guide/mcp-integration.md
printf '%s\n' '--- project tests and docs for the MCP entry point ---'
rg -n -A8 -B8 'mcp\.server|hebb-mcp|serve\(' tests src/hebb repo_pages/guide/mcp-integration.md pyproject.toml \
  | head -240

Repository: afx-team/hebb-mind

Length of output: 26920


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import ast
import inspect
import subprocess
from pathlib import Path

targets = [
    Path("repo_pages/guide/agent-frameworks.md"),
    Path("repo_pages/zh/guide/agent-frameworks.md"),
]
for path in targets:
    text = path.read_text()
    blocks = text.split("```python")
    matches = [b.split("```", 1)[0] for b in blocks if "HebbMCPTrait" in b]
    assert len(matches) == 1, (path, len(matches))
    block = matches[0]
    tree = ast.parse(block)
    classes = [
        node for node in tree.body
        if isinstance(node, ast.ClassDef) and node.name == "HebbMCPTrait"
    ]
    assert len(classes) == 1
    class_node = classes[0]
    run_methods = [
        node for node in class_node.body
        if isinstance(node, ast.FunctionDef) and node.name == "_run"
    ]
    assert len(run_methods) == 1
    calls = [
        node for node in ast.walk(run_methods[0])
        if isinstance(node, ast.Call)
        and isinstance(node.func, ast.Attribute)
        and node.func.attr == "run"
    ]
    assert len(calls) == 1
    argv = calls[0].args[0]
    assert isinstance(argv, ast.List)
    argv_text = [
        elt.value if isinstance(elt, ast.Constant) else ast.unparse(elt)
        for elt in argv.elts
    ]
    print(f"{path}: class_only=True subprocess_argv={argv_text}")
    assert "Agent(" not in block and "Crew(" not in block

server = Path("src/hebb/mcp/server.py").read_text()
server_tree = ast.parse(server)
main = next(
    node for node in server_tree.body
    if isinstance(node, ast.FunctionDef) and node.name == "main"
)
main_calls = [
    node for node in ast.walk(main)
    if isinstance(node, ast.Call)
    and isinstance(node.func, ast.Attribute)
    and node.func.attr == "run"
]
print("src/hebb/mcp/server.py: main_mcp_run_calls=", len(main_calls))
assert len(main_calls) == 1
assert any(
    kw.arg == "transport"
    and isinstance(kw.value, ast.Constant)
    and kw.value.value == "stdio"
    for kw in main_calls[0].keywords
)
print("src/hebb/mcp/server.py: transport='stdio', no CLI call dispatch in main")

sig = inspect.signature(subprocess.run)
params = sig.parameters
print(
    "subprocess.run defaults:",
    "check=", params["check"].default,
    "timeout=", params["timeout"].default,
)
assert params["check"].default is False
assert params["timeout"].default is None
PY

Repository: afx-team/hebb-mind

Length of output: 575


Replace the CrewAI MCP subprocess examples with a real MCP client integration.

hebb-mcp starts a stdio MCP server. It does not implement a call subcommand. The current command does not invoke action and can wait for MCP protocol input. Both HebbMCPTrait classes are also never attached to an Agent or Crew. Use a supported MCP adapter, attach the tool to an agent, and handle transport errors and timeouts in both language pages.

📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L128-L143 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L125-L141
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 128 - 143, Replace the
invalid subprocess-based HebbMCPTrait examples in
repo_pages/guide/agent-frameworks.md (lines 128-143) and
repo_pages/zh/guide/agent-frameworks.md (lines 125-141) with a supported MCP
client/adapter integration for the stdio server. In both pages, show the MCP
tool attached to an Agent and Crew, and include transport-error and timeout
handling; remove the nonexistent hebb-mcp call subcommand usage.

Comment on lines +150 to +179
AutoGen supports MCP servers via `autogen-ext[mcp]`. Connect directly to `hebb-mcp`.

### Using MCP Tools (AutoGen 0.4+)

```python
import asyncio
from autogen import Agent, AssistantAgent, UserProxyAgent
from autogen_ext.tools.mcp import McpSession, McpServerConnectionStdio

async def main():
# Connect to hebb-mcp via stdio
async with McpSession(McpServerConnectionStdio(command="hebb-mcp")) as session:
# List available tools
tools = await session.list_tools()
print("Available tools:", [t.name for t in tools])

assistant = AssistantAgent(
"assistant",
llm_config={"config_list": [{"model": "gpt-4o", "api_key": "YOUR_KEY"}]},
system_message="You have access to Hebb Mind memory. Use the hebb tools to remember and recall.",
)
user = UserProxyAgent("user")

chat_result = await user.initiate_chat(
assistant,
message="I prefer dark mode. Remember that.",
extra_args={"tools": tools},
)

asyncio.run(main())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- candidate files ---'
git ls-files 'repo_pages/guide/agent-frameworks.md' 'repo_pages/zh/guide/agent-frameworks.md'

printf '%s\n' '--- English section ---'
sed -n '125,190p' repo_pages/guide/agent-frameworks.md

printf '%s\n' '--- Chinese section ---'
sed -n '120,185p' repo_pages/zh/guide/agent-frameworks.md

printf '%s\n' '--- AutoGen references ---'
rg -n -C 3 'AutoGen|autogen-ext|McpSession|McpServerConnectionStdio|StdioServerParams|mcp_server_tools|McpWorkbench|autogen_agentchat' repo_pages package.json pyproject.toml 2>/dev/null || true

Repository: afx-team/hebb-mind

Length of output: 9395


🌐 Web query:

AutoGen stable Python MCP StdioServerParams mcp_server_tools McpWorkbench autogen_agentchat AssistantAgent initiate_chat tools

💡 Result:

In AutoGen, the integration of Model Context Protocol (MCP) servers is primarily handled through the McpWorkbench class [1][2]. This class acts as a client that manages the MCP session, allowing your agents to interact with tools, resources, and prompts hosted by an MCP server [1][3][2]. Core Integration Pattern The standard workflow involves three main steps: 1. Configure Connection: Use StdioServerParams to define how to launch and communicate with the local MCP server (e.g., via stdio) [4][5]. 2. Manage Session: Use McpWorkbench as an asynchronous context manager to start and stop the connection [6][1][3]. 3. Expose Tools: You can pass the workbench instance directly to an AssistantAgent, or use workbench.create_toolset to retrieve tools and pass them into the agent's tools parameter [1][7][4]. Key Components - StdioServerParams: Configures the command and arguments used to start the MCP server [6][8]. - McpWorkbench: The central class from autogen_ext.tools.mcp. It automates the discovery, listing, and execution of tools provided by the MCP server [6][3][2]. - AssistantAgent: Can be configured with a workbench (via the workbench parameter) or a toolset to automatically gain access to the MCP server's tools [7][4][2]. Example Workflow async with McpWorkbench(server_params=StdioServerParams(command="uvx", args=["mcp-server-fetch"])) as workbench: agent = AssistantAgent( name="assistant", model_client=model_client, workbench=workbench) result = await agent.run(task="...") Regarding your mention of mcp_server_tools, while some earlier or third-party tutorials may refer to a helper function by that name [5], current official AutoGen documentation emphasizes using the McpWorkbench class directly to manage sessions and expose tools [6][1][2]. Always ensure you only connect to trusted MCP servers, as they can execute commands within your local environment [8][3][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from urllib.request import urlopen
from html.parser import HTMLParser
import re

urls = [
    "https://microsoft.github.io/autogen/stable/reference/python/autogen_ext.tools.mcp.html",
    "https://microsoft.github.io/autogen/stable/user-guide/core-user-guide/components/workbench.html",
    "https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/agents.html",
]

class TextParser(HTMLParser):
    def __init__(self):
        super().__init__()
        self.parts = []
    def handle_data(self, data):
        self.parts.append(data)
    def text(self):
        return "\n".join(self.parts)

for url in urls:
    print(f"\n--- {url} ---")
    try:
        raw = urlopen(url, timeout=15).read().decode("utf-8", "replace")
        parser = TextParser()
        parser.feed(raw)
        text = parser.text()
        lines = [re.sub(r"\s+", " ", line).strip() for line in text.splitlines()]
        matches = [
            line for line in lines
            if any(term in line for term in (
                "StdioServerParams", "McpWorkbench", "mcp_server_tools",
                "autogen_agentchat.agents", "AssistantAgent(", "extra_args",
                "workbench=", "tools=",
            ))
        ]
        print("\n".join(matches[:80]))
    except Exception as exc:
        print(type(exc).__name__, str(exc))
PY

Repository: afx-team/hebb-mind

Length of output: 894


🌐 Web query:

site:github.com/microsoft/autogen "class StdioServerParams" "class McpWorkbench" "autogen_agentchat.agents"

💡 Result:

In the Microsoft AutoGen framework, StdioServerParams and McpWorkbench are components used to integrate Model Context Protocol (MCP) servers with agents [1][2]. These components are found in the autogen_ext.tools.mcp package [3][4][5]. StdioServerParams StdioServerParams is a configuration class used to define how an MCP server is started via standard I/O (stdio) [1][6]. It allows the agent to communicate with an MCP server by executing a command (e.g., python, npx, or uvx) and passing arguments to launch the server process [4][5][2][7]. Key parameters typically include: - command: The executable command to run the server [4][5][7]. - args: A list of arguments to pass to the command [4][5][7]. - read_timeout_seconds: (Optional) Configures the timeout for reading from the server [5][6][2]. McpWorkbench McpWorkbench is a class that wraps an MCP server and provides a unified interface for agents to list, access, and call tools provided by that server [1][5]. It acts as a bridge, allowing an AssistantAgent to utilize MCP tools during its execution [4][2]. Key usage patterns: - Initialization: You initialize McpWorkbench by passing it a server parameter object, such as StdioServerParams [1][6][7]. - Context Management: It is recommended to use McpWorkbench as a context manager (using async with) to ensure the underlying MCP session is properly initialized and cleaned up [1][2]. - Integration: An instance of McpWorkbench is passed to an Agent (such as an AssistantAgent) via the workbench argument, enabling the agent to interact with the connected MCP server [4][2]. Example Usage The following code snippet demonstrates how to integrate these components with an AssistantAgent: import asyncio from autogen_agentchat.agents import AssistantAgent from autogen_ext.tools.mcp import StdioServerParams, McpWorkbench from autogen_ext.models.openai import OpenAIChatCompletionClient async def main -> None: # Define how to run the MCP server params = StdioServerParams( command="uvx", args=["mcp-server-fetch"], read_timeout_seconds=60,) # Use the workbench as a context manager async with McpWorkbench(server_params=params) as workbench: model_client = OpenAIChatCompletionClient(model="gpt-4.1-nano") assistant = AssistantAgent( name="Assistant", model_client=model_client, workbench=workbench,) # The agent can now use tools provided by the workbench await assistant.run("Go to https://github.com/microsoft/autogen and tell me what you see.") asyncio.run(main) Note: When working with StdioServerParams, you should only connect to trusted MCP servers because the component executes commands in the local environment [1].

Citations:


🌐 Web query:

site:microsoft.github.io/autogen/stable "from autogen_agentchat.agents import AssistantAgent" "McpWorkbench"

💡 Result:

In AutoGen, McpWorkbench is a component used to integrate agents with Model Context Protocol (MCP) servers, allowing them to access tools and resources provided by those servers [1][2][3]. Key integration details: 1. Role: The McpWorkbench acts as an MCP client that manages the connection to an MCP server [2]. When assigned to an AssistantAgent, it enables the agent to discover, list, and invoke tools served by the MCP protocol [1][3]. 2. Implementation: It is typically imported from autogen_ext.tools.mcp. You configure it using connection parameters like StdioServerParams (for command-line based servers) or SseServerParams (for SSE-based servers) [1][3]. 3. Usage with AssistantAgent: You provide the initialized workbench instance to the workbench argument when instantiating an AssistantAgent [4][1]. Example snippet: async with McpWorkbench(server_params=params) as workbench: assistant = AssistantAgent( name="Assistant", model_client=model_client, workbench=workbench, reflect_on_tool_use=True,) await assistant.run(task="...") [4][1] Note: When a workbench is assigned to an AssistantAgent, you cannot explicitly assign additional tools directly to the agent; the workbench handles the tool set [4]. Furthermore, you must manage the workbench lifecycle, typically using an asynchronous context manager (as shown above) or by manually calling its start and stop methods [4][2].

Citations:


Update both AutoGen MCP examples to the current AgentChat API.

Use autogen_agentchat.agents, StdioServerParams, and McpWorkbench. Pass the workbench through workbench=workbench and use the current model_client and assistant.run(...) flow instead of llm_config, McpSession, and extra_args={"tools": tools}. Apply the same correction to both language pages.

📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L150-L179 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L145-L176
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 150 - 179, Update both MCP
examples in repo_pages/guide/agent-frameworks.md lines 150-179 and
repo_pages/zh/guide/agent-frameworks.md lines 145-176 to the current AutoGen
AgentChat API: import agents from autogen_agentchat, use StdioServerParams and
McpWorkbench, pass workbench=workbench to AssistantAgent, configure the current
model_client, and invoke assistant.run(...). Remove the legacy McpSession,
llm_config, and extra_args={"tools": tools} flow in both files.

Comment on lines +245 to +259
### Using MCP Tools

```python
from langgraph_prebuilt import create_react_agent
from langchain_mcp_adapters.client import MultiServerMCPClient

async def get_tools():
client = MultiServerMCPClient({
"hebb": {"command": "hebb-mcp"}
})
return await client.get_tools()

tools = await get_tools()
agent = create_react_agent(model="gpt-4o", tools=tools)
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- English source context ---'
sed -n '220,275p' repo_pages/guide/agent-frameworks.md

printf '%s\n' '--- Chinese source context ---'
sed -n '220,270p' repo_pages/zh/guide/agent-frameworks.md

printf '%s\n' '--- Relevant repository references ---'
rg -n --hidden -S \
  'langgraph_prebuilt|langgraph\.prebuilt|MultiServerMCPClient|transport: ["'\'']stdio["'\'']|hebb-mcp' \
  repo_pages package.json pyproject.toml requirements.txt 2>/dev/null || true

printf '%s\n' '--- Candidate dependency/version references ---'
rg -n --hidden -S \
  'langchain-mcp-adapters|langgraph' \
  . -g '!*node_modules*' -g '!*.lock' -g '!repo_pages/guide/agent-frameworks.md' -g '!repo_pages/zh/guide/agent-frameworks.md' \
  2>/dev/null | head -200 || true

Repository: afx-team/hebb-mind

Length of output: 11825


🌐 Web query:

langchain-ai langchain-mcp-adapters MultiServerMCPClient transport stdio create_react_agent langgraph.prebuilt official GitHub

💡 Result:

The MultiServerMCPClient from the langchain-mcp-adapters package is designed to manage connections to multiple Model Context Protocol (MCP) servers, including those using the stdio transport for local subprocess communication [1][2][3]. When using stdio with MultiServerMCPClient, you provide a configuration dictionary where the connection specifies "transport": "stdio", the "command" to run the server, and the "args" containing the absolute path to the server script [1][2][4]. Key integration points and best practices include: 1. Agent Integration: You can retrieve MCP tools using client.get_tools and pass them to LangGraph's create_react_agent function [1][5]. 2. LLM Tool Binding: When creating a ReAct agent, it is critical to ensure your language model is explicitly bound to the retrieved tools using llm.bind_tools(mcp_tools) before passing it to create_react_agent [6]. 3. Stateless by Default: The MultiServerMCPClient is stateless by default, meaning each tool invocation creates a fresh MCP ClientSession and then cleans it up [2][7][5]. 4. Stateful Options: If you require persistent connections, you can use the client.session(server_name) context manager to explicitly manage the lifetime of an MCP session and load tools from it [4][5]. Official documentation and resources for these components can be found in the LangChain MCP Adapters GitHub repository, the LangChain documentation, and the LangChain Python reference site [1][2][3][8].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- LangGraph section and project metadata ---'
sed -n '185,265p' repo_pages/guide/agent-frameworks.md
sed -n '185,262p' repo_pages/zh/guide/agent-frameworks.md
sed -n '45,85p' pyproject.toml

printf '%s\n' '--- Python syntax probe for the documented pattern ---'
python3 - <<'PY'
import ast

samples = {
    "module_level_await": """async def get_tools():
    return []

tools = await get_tools()
""",
    "inside_async_main": """import asyncio

async def main():
    async def get_tools():
        return []
    tools = await get_tools()
    return tools

asyncio.run(main())
""",
}
for name, source in samples.items():
    try:
        ast.parse(source)
    except SyntaxError as exc:
        print(f"{name}: SyntaxError: {exc.msg} at line {exc.lineno}")
    else:
        print(f"{name}: parses as standard Python")
PY

printf '%s\n' '--- Upstream adapter examples (read-only HTTP fetch) ---'
curl -L --fail --silent --show-error \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/README.md |
  rg -n -A18 -B5 'MultiServerMCPClient|transport.*stdio|create_react_agent' | head -160

printf '%s\n' '--- Upstream LangGraph prebuilt import references ---'
curl -L --fail --silent --show-error \
  https://raw.githubusercontent.com/langchain-ai/langgraph/main/README.md |
  rg -n -A3 -B3 'langgraph\.prebuilt|create_react_agent' | head -80 || true

Repository: afx-team/hebb-mind

Length of output: 11694


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Adapter source defaults and stdio config validation ---'
curl -L --fail --silent --show-error \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/langchain_mcp_adapters/client.py |
  rg -n -A35 -B10 'class StdioConnection|transport|command|args|MultiServerMCPClient' | head -260

printf '%s\n' '--- Official example files mentioning stdio ---'
for url in \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/examples/multiple_servers.py \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/examples/multi_server.py \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/examples/README.md
do
  echo "--- $url"
  curl -L --fail --silent --show-error "$url" |
    rg -n -A20 -B5 'stdio|MultiServerMCPClient|command' | head -120 || true
done

printf '%s\n' '--- Package metadata and import path references from upstream ---'
curl -L --fail --silent --show-error \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/pyproject.toml |
  rg -n -A4 -B4 'langgraph|dependencies|name' | head -100

Repository: afx-team/hebb-mind

Length of output: 9823


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Standard Python compilation probe ---'
python3 - <<'PY'
samples = {
    "documented_pattern": """async def get_tools():
    return []

tools = await get_tools()
""",
    "async_main_pattern": """import asyncio

async def main():
    async def get_tools():
        return []
    tools = await get_tools()
    return tools

asyncio.run(main())
""",
}
for name, source in samples.items():
    try:
        compile(source, f"<{name}>", "exec")
    except SyntaxError as exc:
        print(f"{name}: SyntaxError: {exc.msg!r} at line {exc.lineno}")
    else:
        print(f"{name}: compiles as standard Python")
PY

printf '%s\n' '--- Adapter connection type definitions ---'
curl -L --fail --silent --show-error \
  https://raw.githubusercontent.com/langchain-ai/langchain-mcp-adapters/main/langchain_mcp_adapters/sessions.py |
  rg -n -A80 -B10 'StdioConnection|Connection =|transport' | head -260

printf '%s\n' '--- PyPI lookup for the claimed import package ---'
python3 - <<'PY'
import json
import urllib.request
for package in ("langgraph-prebuilt", "langgraph_prebuilt", "langgraph"):
    url = f"https://pypi.org/pypi/{package}/json"
    try:
        with urllib.request.urlopen(url) as response:
            data = json.load(response)
        print(f"{package}: found, latest={data['info']['version']}")
    except Exception as exc:
        print(f"{package}: {type(exc).__name__}: {exc}")
PY

printf '%s\n' '--- Repository language consistency around both documents ---'
python3 - <<'PY'
from pathlib import Path
for path in (Path("repo_pages/guide/agent-frameworks.md"),
             Path("repo_pages/zh/guide/agent-frameworks.md")):
    text = path.read_text()
    latin = sum(c.isascii() and c.isalpha() for c in text)
    cjk = sum('\u4e00' <= c <= '\u9fff' for c in text)
    print(f"{path}: latin_letters={latin}, CJK_letters={cjk}")
PY

Repository: afx-team/hebb-mind

Length of output: 10447


Fix the LangGraph MCP examples before publishing.

Update both blocks to:

  • Import create_react_agent from langgraph.prebuilt.
  • Add "transport": "stdio" and "args": [] to the server configuration.
  • Move await client.get_tools() into async def main() and call asyncio.run(main()).
📍 Affects 2 files
  • repo_pages/guide/agent-frameworks.md#L245-L259 (this comment)
  • repo_pages/zh/guide/agent-frameworks.md#L242-L256
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/guide/agent-frameworks.md` around lines 245 - 259, Update both MCP
examples in repo_pages/guide/agent-frameworks.md lines 245-259 and
repo_pages/zh/guide/agent-frameworks.md lines 242-256: import create_react_agent
from langgraph.prebuilt, add "transport": "stdio" and "args": [] to the server
configuration, and move client.get_tools() into an async main() function invoked
with asyncio.run(main()).

Comment on lines +5 to +7
# Agent 框架集成

Hebb Mind 可以与任何 Python agent 框架配合使用。本文档展示了如何使用 **MCP 工具**或 **REST API** 快速接入 LlamaIndex、CrewAI、AutoGen 和 LangGraph。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

将通用术语统一为中文。

标题和正文使用通用英文词 Agent,小节标题使用 subprocess。请改为 智能体子进程。保留框架名称、API 名称和代码标识符。

-# Agent 框架集成
+# 智能体框架集成
...
-Hebb Mind 可以与任何 Python agent 框架配合使用。
+Hebb Mind 可以与任何 Python 智能体框架配合使用。
...
-### 通过 subprocess 使用 MCP 工具
+### 通过子进程使用 MCP 工具

As per coding guidelines, keep each localized page in one language and translate generic prose terms while preserving framework names and code identifiers.

Also applies to: 125-125

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@repo_pages/zh/guide/agent-frameworks.md` around lines 5 - 7, 将文档标题和正文中的通用英文术语
Agent 统一替换为“智能体”,并将小节标题中的 subprocess 替换为“子进程”。保留
LlamaIndex、CrewAI、AutoGen、LangGraph、MCP、REST API 及代码标识符不变。

Source: Coding guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(integrations): copy-paste "connect in 10 lines" recipes for LlamaIndex / CrewAI / AutoGen / LangGraph

1 participant