This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import json, re, signal, sys, time, requests | |
| OLLAMA_URL = "http://localhost:11434" | |
| MODEL = "qwen2.5:7b-instruct-q4_K_M" | |
| SYSTEM_PROMPT = """You are the PRAXIS Clerk, a 24/7 financial triage agent. Your job is to process incoming data briefs from news feeds, social media, government sources, and market data, then make fast decisions. | |
| For each incoming brief, respond ONLY in this exact format: | |
| VERDICT: [CRITICAL/HIGH/LOW/NOT SIGNIFICANT] | |
| TICKER: [affected ticker(s) or NONE] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """PRAXIS Clerk — triage pipeline. | |
| Polls Postgres for unprocessed briefs, sends each to the Clerk model | |
| via Ollama, parses the structured VERDICT/TICKER/SUMMARY response, | |
| and writes triage results back to Postgres. | |
| Usage: | |
| python3 clerk.py # run once (process all pending) | |
| python3 clerk.py --watch # poll continuously |