- Removed instructions exclusion from export pipeline so system prompts flow through - Added system_prompt field to registration payload for compliance audits - Added tool_resources and actions to metadata - Created README.md and CLAUDE.md for project documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
Agent Sync - Project Context
Overview
This is the agent-sync tool — a lightweight pipeline that exports agent metadata from LibreChat's MongoDB and registers it with the Agent Tracker API. It runs on the optical-librechat GCP server as a daily cron job.
Architecture
- No running service — these are standalone scripts triggered by cron
- Pipeline:
export_shared_agents.js(MongoDB export) ->shared_agents.json->register_agents.py(API POST) - Orchestrated by
weekly_agent_sync.sh
Key Files
export_shared_agents.js— MongoDB aggregation pipeline run viamongoshinside thechat-mongodbDocker container. Queriesaclentries,agents,users,conversations,messages, andtransactionscollections.register_agents.py— Python script that maps exported fields to the Agent TrackerAgentCollectorCreateschema and POSTs them. Has retry logic, dry-run mode, and result logging.weekly_agent_sync.sh— Bash wrapper for the full pipeline. Deployed to/opt/agent-sync/on the server.
Server Details
- Server:
optical-librechat(GCP) - Deploy path:
/opt/agent-sync/ - LibreChat source:
/home/michael_clervi/LibreChat/(Docker Compose, owned by michael_clervi) - Cron:
0 0 * * *(daily midnight, root crontab) - MongoDB container:
chat-mongodb, databaseLibreChat
API Target
- Endpoint:
https://ai-sandbox.oliver.solutions/agent_collector/agents - Auth: Static API key via
X-API-Keyheader - SSL verification is disabled (internal/dev API)
Conventions
- The JS export script uses MongoDB Extended JSON (relaxed mode)
- The Python script prunes
None/empty fields before POSTing shared_agents.jsonandregistration_results.jsonare generated output — not committed- Python dependencies are minimal:
requestsandurllib3only
Dependencies
- Agent Tracker API must accept any new fields added to the payload (Pydantic model:
AgentCollectorCreate). Unknown fields are silently stripped. - The
system_promptfield requires Agent Tracker to be updated to accept it.
Deployment
Files are copied manually to /opt/agent-sync/ on the server. No restart needed — scripts execute on-demand via cron.