The VAMP Agent is a stealthy, browser-based deep content analysis tool that scrapes, reads, scores, and normalizes information from platforms like:
- π§ Outlook / Office365
- βοΈ OneDrive
- π§Ύ Google Drive
- π NextCloud
- π eFundi LMS
It uses Playwright for authenticated browser automation, NWU Brain for scoring extracted evidence, and a WebSocket bridge for frontend-extension integration.
β οΈ Platform automation notice: Use this project only where you have explicit permission to automate logins, scraping, or metadata extraction. Review each platform's terms of service and anti-automation policies (Outlook/Office365, OneDrive, Google Drive, NextCloud, eFundi) before running connectors, and add any required trademark or usage notices when demonstrating the tool.
Unified Agent Server (backend.app_server)
βββ REST API (/api/*)
β βββ Auth vault + audit (backend.agent_app.auth_manager)
β βββ Connector plugins (backend.agent_app.plugin_manager)
β βββ Evidence vault (backend.agent_app.evidence_store)
β βββ Self-update status (backend.agent_app.update_manager)
βββ WebSocket bridge / automation runtimes
βββ backend.ws_bridge β frontend extension
βββ backend.vamp_agent β NWU Brain (scoring)
VAMP/
βββ README.md
βββ backend/ # Python backend package
β βββ agent_app/ # Agent-as-app runtime (vault, plugins, API)
β βββ data/
β β βββ agent_app/ # Connector manifests + persisted config
β β βββ nwu_brain/ # Scoring manifest + policy knowledge base
β β βββ states/ # Browser storage state (created at runtime)
β β βββ store/ # User evidence store (created at runtime)
β βββ platform_plugins/ # Built-in connector implementations
β βββ nwu_brain/ # NWU scorer implementation
β βββ app_server.py
β βββ vamp_agent.py
β βββ vamp_master.py
β βββ vamp_runner.py
β βββ vamp_store.py
β βββ ws_bridge.py
βββ frontend/
β βββ extension/ # Chrome extension source (incl. icons/, sounds/)
βββ requirements.txt
βββ scripts/
βββ setup_backend.bat # one-click Windows bootstrap
βββ quick_restart_backend.bat
βββ refresh_state.py
βββ SETUP_GUIDE.md
- π Session-state auth: refreshable Playwright storage_state files captured locally (no cloud OAuth flows)
- π§ Full content scraping + keyword scoring
- π Auto-scroll & deep content extraction
- πΎ Durable browser storage states with optional password vault entries for scripted logins
- π Works with Google, Microsoft, Sakai platforms
- πͺ‘ Integrated with NWU's custom scoring engine
- π§Ύ Emits per-scan evidence counts to simplify "zero result" troubleshooting
- π§± Modular plugin design: connectors can be enabled/disabled or reconfigured live from the agent dashboard
- π Evidence vault + chain-of-custody controls surfaced via REST/CLI
- π Self-update checks and rollback orchestration managed by the agent
- Keep the NWU Brain corpus (policy text, clause packs, routing manifests) within approved NWU environments. Do not forward the raw corpus to third-party AI endpoints or logging providers without explicit approval and a data-sharing agreement.
- When inspecting prompts or debugging AI calls, redact policy text in logs. The backend already sends only canonical, scored fields to the assistant; avoid additional logging of full prompts.
- Refer to
backend/data/nwu_brain/PROVENANCE.mdto confirm ownership/permission for each knowledge asset before redistribution.
- Python 3.10+
- Chrome installed (uses your live profile)
Playwright+ browser dependencies installed- Optional: selective content-handling extras (OCR, archive inspection, MIME sniffing). See
docs/connector_reliability.mdfor a minimal, install-as-needed list.
pip install -r requirements.txt
playwright installIf you need broader content handling (OCR, archives, Office docs) without bloating the default install, cherry-pick the packages listed in docs/connector_reliability.md rather than installing everything by default.
python -m backend.app_serverThe server exposes a REST API on http://localhost:8080/api/* that powers:
/api/healthβ consolidated diagnostics/api/connectorsβ manage platform plugins (enable/disable/update without restarts)/api/auth/*β refresh Playwright session state, inspect audit trails, and rotate saved passwords/api/evidenceβ browse or purge retained evidence with chain-of-custody logs/api/updates/*β self-update checks, apply, and rollback
backend.ws_bridgeand the browser extension now communicate via the agent server. Existing automation entrypoints (vamp_agent.py) continue to function but source credentials and configuration exclusively from the agent runtime.
Hosts and ports follow the architecture defaults (VAMP_AGENT_HOST=127.0.0.1, VAMP_AGENT_PORT=8080).
If you prefer the Windows helper, run scripts\setup_backend.bat (see docs/SETUP_BACKEND.md). It provisions the virtual environment, installs requirements and Playwright browsers, then starts backend.app_server. AI dependencies are optional; the script will print that Ollama is optional and continue.
Once the server is running, hit GET /api/ai/status to confirm that:
- the socket bridge sees your browser session (
runtime.connected_clients), - the last WebSocket action routed through the backend is logged, and
- the NWU Brain corpus is loaded (
backend.brain.system_prompt_bytesandassets).
Example:
curl http://127.0.0.1:8080/api/ai/status | jqThe response shows health metrics and includes a short preview of the compiled NWU system prompt so you can verify the correct corpus is loaded.
Open frontend/dashboard/index.html in a modern browser to view health metrics, toggle connectors, inspect auth sessions, browse evidence, and trigger self-updates. The page speaks directly to the agent APIβno additional build step required.
Optional flags (see docs/SETUP_BACKEND.md for more):
VAMP_AGENT_HOST/VAMP_AGENT_PORT(defaults:127.0.0.1:8080) β bind address for REST + Socket.IO.VAMP_AGENT_ENABLED(default:0/false) β gate the agent + SocketIO bridge. Set to1to allow the Playwright agent to start and enqueue evidence; leave unset/0to run the dashboard read-only.START_WS_BRIDGE(default:0) β start the legacybackend.ws_bridgehelper (listens onAPP_HOST/APP_PORT, default127.0.0.1:8765).
If you need a fully local UI instead of the browser extension, launch the Tkinter wrapper and call the backend directly:
python frontend/offline_app/offline_app.pyUse the Run monthly scan button to invoke backend.vamp_master.scan_and_score on any folder, and Build year summary to run backend.vamp_runner across the generated _out/audit.csv files. For a standalone executable, build with PyInstaller: pyinstaller --onefile --noconsole frontend/offline_app/offline_app.py.
-
Perform the very first login for each platform manually in a normal, non-headless Chrome window (Playwright will prompt you if a session is missing).
-
Once authenticated, capture or refresh the storage state with either option:
- Dashboard: click "Refresh browser session state" in the Session State section to trigger
/api/auth/session/refresh. - CLI:
python scripts/refresh_state.py outlook --identity user@nwu.ac.za
- Dashboard: click "Refresh browser session state" in the Session State section to trigger
-
The refreshed
storage_stateJSON is recorded underbackend/data/states/<service>/<identity>/and referenced automatically for subsequent scans. No OAuth/cloud tokens are persisted.
If you want the agent to perform a fully automated login (instead of manual capture) you can still seed a username/password in the vault:
curl -X POST http://localhost:8080/api/auth/password \\
-H 'Content-Type: application/json' \\
-d '{"service": "outlook", "identity": "user@nwu.ac.za", "password": "<password>", "metadata": {"username": "user@nwu.ac.za"}}'Audit entries for session refreshes and password updates are written to agent_app/auth.log for troubleshooting.
- Run the backend
python -m backend.app_server(binds REST + Socket.IO tohttp://127.0.0.1:8080).- Wait for the log line announcing the Socket.IO endpoint; leave this terminal running.
- Load the extension in Chrome
- Visit
chrome://extensions, enable Developer mode, and click Load unpacked. - Select
frontend/extension/; the popup will default tohttp://127.0.0.1:8080for both API and WebSocket.
- Visit
- Do the first Outlook scan
- Open Outlook in a tab and click the VAMP toolbar icon.
- Verify the popup shows Connected; if not, click Reconnect.
- Enter your email, year, and month (and optionally a custom sign-in URL), then press Scan Active.
- Watch the progress bar and evidence list populate; the status should reach Complete.
- Export CSV
- From the same popup, pick the year/month and click Export Month CSV to write a CSV under
backend/data/store/<uid>/<year>/reports/. - Use Compile Year CSV if you want the full academic year in one file.
- From the same popup, pick the year/month and click Export Month CSV to write a CSV under
python -m backend.ws_bridgeThe bridge now relies on the agent server for configuration and authentication. Runtime data (Chrome storage states, vault metadata, evidence, audit logs) is surfaced through the dashboard API instead of ad-hoc file inspection.
- Frontend triggers
"scanActive"with:
{
"action": "scanActive",
"email": "user@nwu.ac.za",
"url": "https://outlook.office365.com/mail/",
"year": 2025,
"month": 11
}- Backend invokes
run_scan_active(...) - Browser is launched and logs into Outlook using session state
- Emails are parsed, filtered, scored and returned to the frontend
| Platform | Status | Notes |
|---|---|---|
| Outlook | β | MFA/login handled manually first |
| OneDrive | β | Uses state restore for auth |
| GoogleDrive | β | Uses persistent context |
| eFundi | β | No auth needed |
- WebSocket connection failed: Ensure
python -m backend.app_serveris running and reachable athttp://127.0.0.1:8080. If you changed ports, updatefrontend/extension/config.jsonormanifest.jsonaccordingly, then reload the unpacked extension. chrome-extension://β¦is not an accepted origin: SetVAMP_CORS_ALLOWED_ORIGINS=*(or add your extension ID explicitly) before startingbackend.app_serverso Socket.IO accepts the extension origin. Restart the backend after changing the env var.- Automated login crashed / Playwright not installed: Install the browsers with
python -m playwright install chromium(from your virtualenv) and retry. If headless automation still fails, fall back to manual session capture via/api/auth/session/refreshas described above. | NextCloud |β οΈ | Placeholder - manual add required |
| File / Folder | Description |
|---|---|
backend/vamp_agent.py |
Core scraping + Playwright automation |
backend/ws_bridge.py |
WebSocket bridge to frontend |
backend/nwu_brain/scoring.py |
Loads NWU brain manifest + scoring logic |
backend/data/nwu_brain/*.json |
Manifest, policy registry, routing rules |
backend/data/states/ |
Chrome storage states (generated at runtime) |
backend/data/store/ |
Evidence store per user (generated) |
All extracted items are passed to the NWUScorer which assigns:
kpa: Key Performance Areatier: Risk/priority tierscore: Numerical scoreband: Banding (e.g. "Developing")policy_hits: Keyword/policy matches
The system does not use OAuth.
- Instead, it authenticates via live Chrome profile.
- First-time use requires manual login in browser.
- Persistent state is saved for reuse:
outlook_state.jsononedrive_state.jsondrive_state.json
- β
Ensure
playwright installis complete - β
Always launch with
python -m backend.ws_bridge - π Check for blocked browser login prompts
- π§ͺ Use
--headless=FalseinBROWSER_CONFIGto see browser - π§ͺ Logs appear in terminal: scan status, scoring feedback
- Modify
backend/vamp_agent.pyto add new platforms - Adjust selectors in
scrape_*functions - Use
logger.info()to trace progress - Patch in
backend/data/nwu_brain/for updated policies or scoring
Internal use only β NWU Research and Policy Development.
Built with β€οΈ using:
- Microsoft Playwright
- Python 3.10
- NWU's brain.json and scoring logic