feat: add 6 production-ready plugins
All plugins are stdlib-only Python with no external dependencies. - auto-summarizer: extractive conversation summary for long context compression, persists per-agent summaries to disk - conversation-logger: JSONL audit logs per agent with ISO 8601 timestamps, auto-creates log directory tree - guardrails: safety filter detecting PII (email, phone, SSN, CC), prompt injection patterns, and credential exposure via regex - keyword-memory: extracts entities (emails, URLs, dates, technical terms like camelCase/snake_case/dotted identifiers) as memories - sentiment-tracker: keyword-based sentiment scoring with intensifiers and negation handling, only injects context for non-neutral sentiment - todo-tracker: detects action items via 7 task patterns, tracks completion, deduplicates, persists per-agent with 20-item FIFO limit
This commit is contained in:
1 parent
994b60c0d9
commit
afcb260554
25 files changed
+1396
-4
No files matched your search
@@ -0,0 +1,34 @@
|
||||
# conversation-logger
|
||||
|
||||
Logs all conversations to JSONL files for auditing, analytics, and debugging. Each agent gets its own log file at `~/.librefang/logs/conversations/{agent_id}.jsonl`.
|
||||
|
||||
## Log Format
|
||||
|
||||
Each line is a JSON object:
|
||||
|
||||
```json
|
||||
{
|
||||
"timestamp": "2026-03-21T12:34:56Z",
|
||||
"agent_id": "agent-abc123",
|
||||
"turn_number": 5,
|
||||
"message_count": 10,
|
||||
"last_user_message": "truncated to 200 chars...",
|
||||
"last_assistant_message": "truncated to 200 chars..."
|
||||
}
|
||||
```
|
||||
|
||||
## Hooks
|
||||
|
||||
| Hook | Script | Description |
|
||||
|------|--------|-------------|
|
||||
| after_turn | `hooks/after_turn.py` | Appends a log entry after each conversation turn |
|
||||
|
||||
## How It Works
|
||||
|
||||
After each conversation turn the hook extracts summary information from the messages array and appends a single JSON line to the agent's log file. User and assistant messages are truncated to 200 characters to keep log files manageable.
|
||||
|
||||
Errors from the filesystem (permissions, disk full, etc.) are caught silently so the agent conversation is never interrupted by a logging failure.
|
||||
|
||||
## Usage
|
||||
|
||||
Installed automatically when enabled in agent configuration. Log files are created on first write -- no manual setup required.
|
||||
Reference in new issue
Block a user