DEV Community

lizer yang for SmartGate

Posted on

AI Agent Architecture: LangGraph vs CrewAI vs a Gateway

Originally published at AI Agent Architecture: LangGraph vs CrewAI vs a Gateway on smartgate.network.

A shorter version of "AI Agent Architecture: LangGraph vs CrewAI vs a Gateway" — the full piece lives at smartgate.network.

What the full piece covers

  • The short version for whoever signs off on the agent budget — An agent architecture has two budgets, and diagrams usually show one.
  • What the AI agent architecture SERP already covers — Two searches, two questions. The AI Overview for ai agent architecture decomposes the class into perception, an LLM reasoning engine, memory, an action layer and a feedback loop, then splits it into single agents and multi-agent orchestration that names LangGraph …
  • ModuleRegistry: the one place agent modules register — class ModuleRegistry: """管理所有算法模块的注册、初始化、查询。""" def init(self): self._modules: Dict[str, SmartModule] = {} @property def modules(self) -> Dict[str, SmartModule]: return self._modules def register(self, module: SmartModule) -> None: if module.name in self._modules: logger.warning(f"Module '{module.name}' already registered, overwriting.") self._modules[module.name] = module logger.info(f"Registered module: {module.name} v{module.version}") …
  • resolve_pipeline_tool_name: the name the model calls versus the module that runs — def resolve_pipeline_tool_name(tool_name: str) -> str: """Map MCP-facing tool names to registry module names.""" name = (tool_name or "").strip() if not name: return name if name in MCP_TOOL_TO_MODULE: return MCP_TOOL_TO_MODULE[name] if name in PIPELINE_ORCHESTRATORS: raise KeyError(f"'{name}' is a pipeline orchestrator, not …
  • resolve_pipeline_step_params: how a step gets its query, url and text — def resolve_pipeline_step_params( module_name: str, params: Dict[str, Any], pipeline_ctx: PipelineContext, run_inputs: Optional[Dict[str, Any]] = None, pipeline_template: str = "", ) -> Dict[str, Any]: """Inject query/url/text across template steps from run inputs and prior results.""" resolved = dict(params) inputs = run_inputs or …
  • smart_pipe: orchestration that keeps one agent infrastructure in one call — @server.tool( name="smart_pipe", description=TOOL_DESCRIPTIONS["smart_pipe"], annotations=ToolAnnotations( title="Pipeline orchestrator", readOnlyHint=False, ), ) async def smart_pipe( template: str = Field( default="", description="Built-in template: research, read, or remember.
  • register_mcp_tools: seven tools, one registry function — def register_mcp_tools(server: FastMCP) -> None: """Register all 7 smart_* tools on a FastMCP instance.""" @server.tool( name="smart_fetch", description=TOOL_DESCRIPTIONS["smart_fetch"], annotations=tool_annotations("smart_fetch"), ) async def smart_fetch( url: str = Field(description="Full HTTP or HTTPS URL to fetch."), timeout: int = Field(default=30, description="HTTP timeout in seconds.") …
  • tool_annotations: read-only hints for agent tool contracts — def tool_annotations(name: str) -> ToolAnnotations: return ToolAnnotations( title=TOOL_TITLES.get(name), readOnlyHint=name in READ_ONLY_TOOLS, ) Five lines, two derived values: the display title from TOOL_TITLES and the read-only hint from membership in READ_ONLY_TOOLS.
  • …plus 9 more section(s).

Read the full piece: AI Agent Architecture: LangGraph vs CrewAI vs a Gateway on smartgate.network.

Top comments (0)