NovaCorp Operations Assistant
A multi-agent operations assistant that answers business questions by searching local documents and order records.
README
NovaCorp Operations Assistant
MCP + CrewAI — Week 14 Mini-Project (Futurense AI Clinic)
A multi-agent operations assistant that answers business questions by searching local documents and order records. Built with FastMCP (MCP server) and CrewAI (agents). Runs locally with a free/local LLM — no paid API required.
What It Does
Given a natural-language question, a crew of three agents:
- Researcher — searches NovaCorp's policy docs, product notes, and support tickets; reads order records by ID
- Writer — synthesises evidence into a sourced markdown report saved to
outputs/ - Critic — cross-checks every claim in the report against the retrieved evidence
Every answer cites its source. If no evidence is found, the agent says so rather than guessing.
Project Structure
.
├── data/
│ ├── documents/ # 10 NovaCorp policy/product/ticket docs
│ └── records.csv # 23-row orders dataset
├── mcp_server/
│ └── server.py # FastMCP server: 3 tools + 1 resource
├── crew/
│ ├── agents.py # Researcher, Writer, Critic agents
│ ├── tasks.py # Task definitions
│ └── main.py # Crew entry point (CLI)
├── tests/
│ ├── test_tools.py # Unit tests (no server needed) — 18 passing
│ └── test_crew_e2e.py # End-to-end crew test
├── examples/ # 3 sample Q&A outputs with Critic verdicts
├── traces/ # Auto-saved run traces (JSON + MD)
├── outputs/ # Reports written by save_report tool
├── docs/ # Original assignment brief
├── .env.example # Copy to .env — no secrets committed
├── ai_usage_log.md # AI tool usage + real bugs found
├── decision_log.md
├── reflection.md
└── requirements.txt
Quick Start (Fresh Clone)
1. Clone and install dependencies
git clone <repo-url>
cd <repo-folder>
pip install -r requirements.txt
2. Configure your LLM
Copy .env.example to .env and choose one LLM backend:
Option A — Ollama (recommended, fully local & free)
# Install Ollama from https://ollama.com, then pull the model:
ollama pull llama3.2:3b
# Then:
cp .env.example .env # already configured for llama3.2:3b
Option B — Groq (free tier, cloud)
cp .env.example .env
# Edit .env: uncomment GROQ_API_KEY and set your key from console.groq.com
Option C — OpenAI (paid)
cp .env.example .env
# Edit .env: uncomment OPENAI_API_KEY and set your key
3. Run the crew
python crew/main.py "What is the return policy for damaged goods?"
python crew/main.py "What is the status of order ORD-0021?"
python crew/main.py "What warranty does the NX-500 carry?"
The crew will:
- Connect to the MCP server automatically over stdio
- Search documents and/or read order records
- Write a sourced report to
outputs/ - Save a run trace to
traces/ - Ask for your approval before writing the report (unless
AUTO_APPROVE=truein.env)
Inspect the MCP Server
Open the MCP Inspector to verify all tools and the resource are registered:
npx @modelcontextprotocol/inspector python mcp_server/server.py
You should see three tools (search_documents, read_record, save_report) and one resource (documents://list).
Run Tests
# Unit tests — no LLM needed
pytest tests/test_tools.py -v
# End-to-end test — requires a running LLM
pytest tests/test_crew_e2e.py -v
Environment Variables
| Variable | Default | Description |
|---|---|---|
OLLAMA_MODEL |
ollama/llama3.2:3b |
Ollama model to use |
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama endpoint |
GROQ_API_KEY |
(unset) | Groq API key — overrides Ollama if set |
GROQ_MODEL |
groq/llama3-70b-8192 |
Groq model |
OPENAI_API_KEY |
(unset) | OpenAI key — overrides Ollama if set |
OPENAI_MODEL |
openai/gpt-4o-mini |
OpenAI model |
AUTO_APPROVE |
false |
Skip human approval gate for save_report |
USE_HIERARCHICAL |
false |
Use CrewAI hierarchical (manager) process |
Stretch Features Implemented
| Feature | How |
|---|---|
| Human approval gate | save_report writes approval prompt to stderr; operator creates outputs/.approve to allow (or set AUTO_APPROVE=true) |
| Self-check / Critic | Third agent verifies Writer's claims against evidence using search_documents |
| Observability | Every run saves traces/trace_*.json + traces/run_report_*.md with timing |
| Hierarchical process | Set USE_HIERARCHICAL=true for manager + worker process via Process.hierarchical |
Security Notes
- All tool inputs validated with Pydantic; path traversal attempts are rejected
- No secrets committed — use
.envonly (never.env.examplewith real keys) save_reportrequires explicit human approval before writing to disk- MCP server runs over stdio — only trusted local processes connect to it
max_iter=5on all agents prevents runaway loops
Sample Questions
"What is the return policy for damaged goods?""What is the status of order ORD-0021?""What warranty does the NX-500 carry and what is its price?""What was the resolution for support ticket #0019?""When should a support ticket be escalated to Tier 3?"
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。