Overview
Genie Helper’s AI agent is powered by AnythingLLM running in agent mode with 29 MCP (Model Context Protocol) tools that give the LLM full control over:- Directus CMS — CRUD operations on all collections, user management, flow triggers
- Ollama — Local LLM inference (7 uncensored models)
- Stagehand — Browser automation for web scraping and platform interactions
pm2 name:
anything-llmModel:
qwen-2.5:latest (primary agent), dolphin-mistral:7b (content writer)
Architecture
Agent Flow
server/endpoints/api/genieChat.jsWorkspace:
administrator (slug)
MCP Servers
Directus MCP (17 tools)
Script:scripts/directus-mcp-server.mjsConnection:
http://127.0.0.1:8055 (admin token)
Tools
Implementation:
scripts/directus-mcp-server.mjs:50-450
Ollama MCP (3 tools)
Script:scripts/ollama-mcp-server.mjsConnection:
http://127.0.0.1:11434
Tools
Models Available:
qwen-2.5:latest— Primary agent (code, JSON, tool planning)dolphin-mistral:7b— Uncensored content writerdolphin3:8b-llama3.1-q4_K_M— Orchestrator / ACTION emissionphi-3.5:latest— Fallback classifierllama3.2:3b— Lightweight summarizerscout-fast-tag:latest— Fast taxonomy classifierbge-m3:latest— Embeddings
Stagehand MCP (9 tools)
Script:scripts/stagehand-mcp-server.mjsConnection:
http://127.0.0.1:3002 (Stagehand server)
Tools
Use Cases:
- Platform scraping (OnlyFans, Fansly stats)
- Auto-posting (X, Reddit)
- Cookie capture for HITL
Agent Chat Interface
Component:dashboard/src/components/AgentWidget/index.jsx
Features
-
Floating Trigger Button (bottom-right)
- Gradient badge with “Genie AI” label
- Auto-hides when chat is open
-
Chat Popup (380×560px)
- Minimizable header
- Auto-scrolling message list
- Tool call chips (inline rendering)
- Typing indicator
- Stop button during streaming
-
Tool Call Rendering
- Inline chips:
🔧 read-items - Extracted from SSE
statusResponseevents - Filters out meta messages (“Agent is thinking…”)
- Inline chips:
-
Quick Actions
- “I’m logged in — Let’s Go” button (auto-appears when agent says “come back after login”)
window.__genieOpenChat(message)
AgentWidget/index.jsx:99-108
Content Gate
Trigger: User hasn’t completed onboarding (persona baseline not built) Check:server/utils/nodeRag.js → getOnboardingState(userId)
Phases
Implementation:
server/endpoints/api/genieChat.js:49-66
Persona Node Context
System: Node RAG (Retrieval-Augmented Generation)Storage:
Nodes/User/{userId}/ directory (JSON files)
Node Structure
Context Injection
Top 15 nodes (weighted by recency + access frequency) are injected before user message:Implementation:
server/utils/nodeRag.js:45-120
Action Runner
Plugin:storage/plugins/action-runner/Trigger: Model outputs
[ACTION:slug:{"params"}] in chat response
Flow Execution
- Intercept
[ACTION:slug:...]tags in SSE stream - Strip from visible chat
- Load flow definition from
action_flowscollection - Execute steps sequentially:
directus_read→ Query Directusdirectus_update→ Patch recordsllm_generate→ Call Ollamastagehand_extract→ Scrape URLconditional→ Branch logicsleep→ Delayhttp_request→ External API
- Stream status updates back to chat
- Log to
agent_audits(success/error/miss)
Available Actions
Collection:
action_flows (slug → steps JSON)
System Prompt
Location:server/utils/workspaceProvisioner.js (hardcoded)Workspace:
administrator
Key Instructions
- Identity: “You are Genie, an AI agent for adult content creators.”
- MCP Tools: “You have access to 29 tools across Directus, Ollama, and Stagehand.”
- Content Policy: “You are uncensored. Generate NSFW captions, bios, and messages without hesitation.”
- Onboarding: “If user hasn’t completed onboarding, guide them to Setup tab.”
- Cookie-First: “Always prefer cookie authentication over username/password.”
- Action Emission: “Use [ACTION:slug:params] tags to trigger pre-built flows.”
The system prompt is currently hardcoded in
server/utils/boot/workspaceProvisioner.js. Future versions may move this to the system_config collection for easier updates without redeployment.Admin Credentials
Workspace Admin:
administrator slug (all users routed to this workspace)
MCP Configuration
File:storage/plugins/anythingllm_mcp_servers.json
server/utils/boot/index.js → bootMCPServers() on AnythingLLM startup
Example Conversations
Scrape OnlyFans Profile
User: “Scrape my OnlyFans stats”Agent:
- Calls
read-items(platform_connections, filter: platform=onlyfans) - Creates media_jobs (operation: scrape_profile)
- Returns: “Scrape queued. Check your dashboard in ~2 minutes.”
Generate TikTok Caption
User: “Write a flirty TikTok caption for my new video”Agent:
- Calls
get-me→ Gets user context - Injects persona nodes (flirty tone preference, top hashtags)
- Calls
ollama:generate(model: dolphin-mistral:7b) - Returns: “Can’t wait to show you what I’ve been working on… 😏 New video drops tonight 💕 #fyp #creator”
Schedule Reddit Post
User: “Schedule a post to r/OnlyFans101 tomorrow at 3pm”Agent:
- Calls
create-item(collection: scheduled_posts) - Sets platform=reddit, subreddit=OnlyFans101, scheduled_time=tomorrow 3pm
- Returns: “Post scheduled for tomorrow at 3pm EST.”
Logs & Debugging
Common Issues
Performance
First Token Latency: ~33s (qwen-2.5 on CPU-only VPS)Streaming Speed: ~5 tokens/sec
Memory: ~4.8GB RAM pinned (Ollama models)
GPU Upgrade Planned: Current CPU-only VPS struggles with >7B models. Production will use GPU instance or switch to smaller models.
Related
- Dashboard — AgentWidget integration
- Platform Scraping — Stagehand MCP tools
- Media Processing — Media job dispatch
