-
Notifications
You must be signed in to change notification settings - Fork 0
AI Agent
RankMySEO includes an optional AI agent layer for conversational SEO assistance.
@rankmyseo/agent — tool definitions, system prompts, and orchestration logic.
The agent can invoke server-backed tools:
| Tool | Description |
|---|---|
scan_url |
On-page analysis of a URL |
generate_meta |
Meta title/description generation |
generate_schema |
Schema.org JSON-LD (Article, Product, FAQ, Breadcrumb, Organization) |
list_keywords |
Tracked keywords for project |
get_rank_history |
Rank snapshots for a keyword |
run_audit |
Trigger site audit |
list_blog_posts |
Blog posts (when enabled) |
create_blog_post |
Create draft post |
Tool schemas live in packages/agent/src/tools/.
import { useRankMySeoChat } from "@rankmyseo/react";
function ChatPanel() {
const { messages, send, streaming, error } = useRankMySeoChat();
return (
<div>
{messages.map((m) => (
<div key={m.id}>{m.role}: {m.content}</div>
))}
<button disabled={streaming} onClick={() => send("Scan my homepage")}>
Send
</button>
</div>
);
}Agent chat is exposed via the server package (streaming SSE or chunked responses depending on adapter). Configure LLM credentials in environment — not bundled in OSS defaults.
Typical variables (exact names in server config):
OPENAI_API_KEY=sk-...
# or compatible OpenAI API endpoint
Without credentials, agent routes return appropriate errors; core rank/audit/blog features work independently.
- Add tool definition in
packages/agent/src/tools/ - Register handler in agent router
- Update system prompt with tool description
- Add tests with mocked LLM responses
The agent is optional. Rank tracking, audits, scan, meta, and blog do not require AI. This matches the product goal: free-first SEO tooling with AI as an enhancement.
See Development for running the agent locally.