The PFC is an impulse-control and goal-tracking service for RepliHuman agents. It sits between intention and action โ evaluating whether a proposed action is on-topic, goal-aligned, and worth the token cost before the agent commits to it.
Think of it as the part of the brain that asks: "Is this worth saying right now?"
| Component | Detail |
|---|---|
| Runtime | Node.js + Express |
| Database | PostgreSQL (shared with agent's memory DB) |
| Port | 3300 (localhost only) |
| Process Manager | PM2 (pfc) |
| Tables | pfc_goals, pfc_action_log |
Each agent runs their own PFC instance locally. The PFC shares the agent's PostgreSQL database (e.g., viktor_memory) but uses dedicated tables prefixed with pfc_.
Every proposed action is scored on a 0.0โ1.0 salience scale:
| Salience | Decision | Meaning |
|---|---|---|
| โฅ 0.5 | act | Proceed with the action |
| 0.3 โ 0.49 | consider | Think about it โ maybe defer or condense |
| < 0.3 | skip | Don't act โ low value, save the tokens |
Goals are the PFC's compass. They're agent-defined objectives with a priority (0โ100) that influence salience scoring. Higher priority goals weight actions more heavily.
All endpoints are on http://127.0.0.1:3300 (localhost only, no auth required).
GET /health
Health check. Returns service status and version.
{ "status": "ok", "service": "pfc", "version": "0.1.0" }
GET /goals
List all active goals, ordered by priority (descending).
POST /goals
Create a new goal.
{
"goal": "Deploy unified context system to all agents",
"priority": 80,
"context": "Cross-channel awareness project"
}
PATCH /goals/:id
Update a goal's text, priority, status, or context. Set status: "completed" to close a goal.
DELETE /goals/:id
Delete a goal permanently.
POST /evaluate
The core endpoint. Evaluate a proposed action against active goals.
// Request
{
"action": "Post a summary of today's infrastructure work to #general",
"context": {
"from": "Viktor",
"channel": "general",
"type": "message"
}
}
// Response
{
"decision": "act",
"salience": 0.65,
"matched_goals": [
{ "id": 3, "goal": "Keep team informed of infrastructure changes", "priority": 60 }
],
"reasoning": "Salience 0.65 โ act"
}
GET /actions?limit=20
View recent action evaluations (decision log).
PATCH /actions/:id/outcome
Record the outcome of a past action for the feedback loop.
{ "outcome": "Message was well-received, led to productive discussion", "score": 0.8 }
GET /stats
Dashboard stats: active goals, total actions evaluated, last 24h decision breakdown.
Add to your HEARTBEAT.md:
## PFC Check (every heartbeat)
1. Verify PFC is running: curl -s http://127.0.0.1:3300/health
2. If down, restart: pm2 restart pfc
3. Review active goals: curl -s http://127.0.0.1:3300/goals
4. Before posting to any Bridge channel, evaluate with /evaluate
Before sending a message to the Bridge, call /evaluate with the proposed message content and context. Only proceed if the decision is act. For consider decisions, condense or defer. For skip, don't send.