| name | add-agent-profile |
| description | Step-by-step procedure to configure a new dict-keyed LangChain, DeepAgent, or DeerFlow agent profile with tools, skills, middleware, and MCP servers in a genai-tk project. |
Add an Agent Profile
Follow these steps to add a new agent profile to a genai-tk project.
Prerequisites
- The project has a
config/agents/ directory
- LangChain profiles are dict-keyed and live under
config/agents/langchain/*.yaml
- See
docs/agents.md and skills/genai-tk/agent-profiles/SKILL.md before changing runtime behavior
Step 1: Edit a LangChain Profile YAML
Add a new profile key to the closest file under config/agents/langchain/:
langchain_agents:
my_agent:
name: My Agent
type: react
llm: default
system_prompt: |
You are a helpful assistant specialized in [domain].
Use the provided tools to answer questions accurately.
tools:
- spec: web_search
config:
provider: tavily
- factory: my_package.tools.my_tools.create_tools
mcp_servers: []
middlewares: []
checkpointer:
type: memory
skills:
directories:
- ${paths.project}/skills
Step 2: Create Custom Tools (if needed)
Create a tool factory function in <package>/tools/my_tools.py:
"""Custom tools for MyAgent."""
from langchain_core.tools import tool
@tool
def my_custom_tool(query: str) -> str:
"""Description of what this tool does - the LLM reads this docstring."""
return f"Result for: {query}"
def create_tools() -> list:
"""Factory function referenced from agent profile YAML."""
return [my_custom_tool]
Step 3: Test the Agent
uv run cli agents langchain --list
uv run cli agents langchain -p my_agent --chat
uv run cli agents langchain -p my_agent "What is the weather today?"
Agent Types
| Type | Description | Use for |
|---|
react | Standard ReAct loop (Thought -> Action -> Observation) | General-purpose tasks |
deep | Multi-step planning with subagents and skills | Complex research/analysis |
custom | LangGraph Functional API - maximum flexibility | Custom workflows |
Tool Configuration Options
tools:
- spec: web_search
- spec: python_repl
- spec: file_search
- factory: mypackage.tools.create_tools
config:
key: value
- tool_class: langchain_community.tools.wikipedia.WikipediaQueryRun
Adding MCP Servers to Agent
- Define external MCP servers in
config/mcp_servers.yaml under mcpServers
- Reference by name in the agent profile:
mcpServers:
my-server:
command: uvx
args: ["my-mcp-server"]
env:
API_KEY: ${oc.env:MY_API_KEY}
langchain_agents:
my_agent:
name: My Agent
mcp_servers: [my-server]
Use config/examples/tk_servers.yaml only when exposing genai-tk assets as project MCP servers served by uv run cli mcp serve.
DeerFlow Agents
For multi-step research agents, configure in config/agents/deerflow.yaml:
deerflow_agents:
- name: Researcher
mode: pro
llm: default
mcp_servers: [tavily-mcp]
skill_directories: [${paths.project}/skills]
Run with: uv run cli agents deerflow --profile Researcher --chat