# MedSearch Zambia Agent
MedSearch Zambia Agent is a Facebook content assistant for planning, generating, approving, scheduling, and publishing patient-safe health education posts.
## Current version
This version is a GitHub Pages front end with secure backend hooks. It supports:
- AI content generation from health topics through a secure AI endpoint
- Approval queue
- Post editing
- Scheduling calendar
- Demo publishing
- Real Facebook publishing through a secure publish endpoint
- Facebook settings screen
- Analytics preview
- Patient-safety checks
## Production connection
Real Facebook publishing must not expose Page Access Tokens in browser JavaScript or GitHub Pages.
Use `api/facebook-publish.example.js` as the backend template and deploy it as a Cloudflare Worker, Vercel Function, Firebase Function, or similar secure server endpoint.
Set these environment variables in the backend service:
```text
META_PAGE_ACCESS_TOKEN=your_regenerated_page_token
META_PAGE_ID=your_facebook_page_id
META_GRAPH_VERSION=v25.0
```
Then open the Agent website:
1. Go to `Facebook Settings`
2. Paste the deployed publish endpoint URL into `Facebook publish endpoint`
3. Change `Publishing mode` to `Production backend required`
4. Click `Test Facebook endpoint`
5. Approve a post, then click `Publish`
If a token was pasted into a chat, screenshot, public page, commit, or shared tool, revoke/regenerate it in Meta before using production publishing.
## Run locally
Open `index.html` directly or serve the folder:
```powershell
python -m http.server 4195 --bind 127.0.0.1
```
Then open:
```text
127.0.0.1
```