How deltaplanoo/agentic-probability-engine works
What this project is (from tree + README)
This repository is a small Python client–server system for “data-driven agentic probability assessment.” With only:
• server.py (service entrypoint)
• client.py (consumer/driver entrypoint)
• requirements.txt (Python deps)
it’s almost certainly a single service that exposes some API (HTTP, gRPC, or raw sockets) and a client that calls it to request probability assessments (likely providing data/features and receiving scores/uncertainty).
• the public interface in server.py (routes/handlers, request/response schemas)
• the call pattern in client.py (how it connects, what it sends, what it expects back)
• runtime dependencies in requirements.txt (FastAPI/Flask, requests, pydantic, numpy/pandas/sklearn, etc.)
Inspect requirements.txt to identify the “platform layer”
This tells you the type of server:
• Flask/gunicorn → HTTP JSON API (WSGI)
• grpcio → gRPC
• websockets → websocket server
• requests/httpx in client → HTTP client
• numpy/pandas/scikit-learn/torch → local model/analytics pipeline in server
• openai/langchain → “agentic” reasoning via external LLM APIs
Inspect server.py to identify runtime components
You’re looking for:
• Server transport: how it listens (host/port), protocol (HTTP, socket), endpoints.
• Core pipeline: functions/classes that transform input → features → probability estimate.
• State: in-memory caches, loaded model artifacts, config, environment variables.
• I/O boundaries: file reads (datasets, model weights), DB usage, external API calls.
Inspect client.py to identify the interaction contract
Extract:
• How it authenticates (API key? none?)
• What requests look like (payload fields)
• Whether it runs in batch mode (reads a file/dataset) or interactive mode
• Retry/timeouts, streaming, concurrency
Client process (client.py)
• Python runtime
• Dependency: requests/httpx/grpcio etc.
Server process (server.py)
• Python runtime
• Web framework (FastAPI/Flask/etc.)
• ML/agent libraries (sklearn/torch/langchain/etc.)
Data/Model artifacts (only if used)
• Local files: dataset CSV/JSON, model pickle, prompt templates
External services (only if used)
• LLM API, vector DB, metrics, etc.
If the server is single-process and stateful (loads model into memory), annotate that clearly.
Break the server into as many components as the code naturally allows. Typical “agentic probability assessment” server might decompose as:
• API Layer / Handlers
• POST /assess or equivalent
• Request Validation / Schema
• pydantic/dataclasses/manual checks
• Assessment Orchestrator
• coordinates steps (“agentic” loop, tool calls, reasoning stages)
• Feature Extraction / Data Prep
• normalization, parsing, missing values
• Model/Estimator
• statistical model / ML model / heuristic estimator
• Calibration / Post-processing
• confidence calibration, thresholds, explanation generation
• Persistence / Logging (optional)
• writes results, audit logs, metrics
• Protocol: HTTP JSON / gRPC / TCP socket
• Key operations:
• “Submit assessment request (data/features)”
• “Return probability + metadata (confidence, explanation, trace)”
• Data flow direction:
• client → server: request payload
• server → client: response payload
• If server calls externals:
• server → External API: “tool call / LLM inference / retrieval”
• External API → server: results
If the client reads inputs from disk and sends them:
• File/Data Source → client → server.
Architectural patterns to highlight (based on likely structure)
• Client–Server with a thin client and a single service performing compute.
Potential secondary patterns to annotate only if they exist in code:
• Pipeline (staged transformations)
• Orchestrator/Agent loop (planner → tool execution → aggregation)
• Stateless vs stateful service
• Stateless: each request independent
• Stateful: loaded model/caches in memory across requests
Technologies to include (how to decide accurately)
• Server framework (FastAPI/Flask/etc.)
• Client HTTP library (requests/httpx)
• ML stack (numpy/pandas/sklearn/torch)
• Agent/LLM stack (langchain/openai)
• Serialization (pydantic/json)
• Deployment runtime (uvicorn/gunicorn)
• “HTTP API Server (Python; framework TBD from requirements)”
and then replace once confirmed.
In server.py, identify
• entrypoint (app creation / socket bind)
• endpoints / message handlers
• main assessment function(s)
• external calls / file reads
In client.py, identify
• how it constructs requests
• input sources and output sinks
• endpoint names, ports, protocols, filenames.