You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CoherenceScorer.review(prompt, response) retrieves KB context using the prompt only (not the response claims). This is by design: retrieval must happen before scoring to provide the fact basis against which claims are evaluated. Searching by response claims would create a circular dependency — you can't retrieve evidence for claims you haven't scored yet. For vague prompts, the heuristic and NLI scoring layers compensate by comparing the response against whatever context the prompt retrieves.
Plugin API
Symbol
Module
Description
ScorerBackend
core.backends
ABC for custom scorer backends
register_backend()
core.backends
Register a custom backend by name
get_backend()
core.backends
Retrieve a backend class by name
list_backends()
core.backends
List all registered backend names
Vector Store Backends
Class
Module
Description
VectorBackend
core.vector_store
ABC for vector backends
InMemoryBackend
core.vector_store
Word-overlap proxy (testing)
ChromaBackend
core.vector_store
ChromaDB production backend
SentenceTransformerBackend
core.vector_store
bge-large-en-v1.5 embeddings
RerankedBackend
core.vector_store
Reranking wrapper
PineconeBackend
core.vector_store
Pinecone backend
WeaviateBackend
core.vector_store
Weaviate backend
QdrantBackend
core.vector_store
Qdrant backend
FAISSBackend
core.vector_store
FAISS backend
ElasticsearchBackend
core.vector_store
Elasticsearch backend
HybridBackend
core.vector_store
BM25 + dense with Reciprocal Rank Fusion
ColBERTBackend
core.vector_store
ColBERT v2 late-interaction retrieval
Vector Backend Plugin API
Symbol
Module
Description
register_vector_backend()
core.vector_store
Register a custom vector backend by name
get_vector_backend()
core.vector_store
Retrieve a vector backend class by name
list_vector_backends()
core.vector_store
List all registered vector backend names
Generators
Class
Module
Description
MockGenerator
core.actor
Deterministic mock candidates
LLMGenerator
core.actor
Real LLM candidate generation
Enterprise (Lazy-Loaded)
Class
Module
Description
TenantRouter
core.tenant
Per-tenant config resolution
Policy
core.policy
Policy rule engine
AuditLogger
core.audit
Structured audit logging
Batch Processing
Class
Module
Description
BatchProcessor
core.batch
Thread-pool batch processing wrapper
BatchResult
core.batch
Batch operation result
ReviewQueue
core.review_queue
Server-level continuous batching accumulator
CoherenceScorer Batch Methods
Method
Description
review(prompt, response)
Single review → (bool, CoherenceScore)
areview(prompt, response)
Async single review (thread pool offload)
review_batch(items)
Batch review — routes each item through review() for full scoring parity → list[(bool, CoherenceScore)]
ReviewQueue (Continuous Batching)
Server-level request accumulator. Collects incoming /v1/review requests and
flushes them as a single review_batch() call per tenant. Session-bound requests
bypass the queue.
Config Field
Type
Default
Description
review_queue_enabled
bool
False
Enable continuous batching queue
review_queue_max_batch
int
32
Flush after N requests accumulate
review_queue_flush_timeout_ms
float
10.0
Flush after N ms (whichever first)
Fine-Tuning
Symbol
Module
Description
FinetuneConfig
core.finetune
Training configuration dataclass
FinetuneResult
core.finetune
Training result (metrics, output path)
finetune_nli()
core.finetune
Fine-tune NLI model on domain data
validate_finetune_data()
core.finetune_validator
Validate JSONL training data
DataQualityReport
core.finetune_validator
Validation report dataclass
benchmark_finetuned_model()
core.finetune_benchmark
Benchmark fine-tuned vs baseline
RegressionReport
core.finetune_benchmark
Benchmark result dataclass
Threshold Tuning
Symbol
Module
Description
TuneResult
core.tuner
Tuning grid search result
tune()
core.tuner
Threshold + weight grid search
Functions
Function
Module
Description
nli_available()
core.nli
Check NLI readiness
export_onnx()
core.nli
Export model to ONNX
export_tensorrt()
core.nli
Export ONNX model to TensorRT
guard()
integrations.sdk_guard
One-liner SDK interceptor (duck-type detection)
get_score()
integrations.sdk_guard
Retrieve last score from context
create_app()
server
Create FastAPI app
create_grpc_server()
grpc_server
Create gRPC server (optional TLS)
score()
integrations.sdk_guard
One-call scoring convenience function
clear_model_cache()
core.nli
Evict cached NLI models to free GPU memory
create_knowledge_router()
knowledge_api
Knowledge ingestion API router
REST Endpoints
Method
Path
Description
POST
/v1/review
Score a prompt/response pair
POST
/v1/verify
Sentence-level multi-signal verification
POST
/v1/process
Full agent pipeline (generate + score)
POST
/v1/batch
Batch review/process
GET
/v1/health
Liveness probe (version, mode, uptime)
GET
/v1/ready
Readiness probe (503 if NLI not loaded)
GET
/v1/source
AGPL §13 source access
GET
/v1/config
Config introspection
GET
/v1/metrics
JSON metrics
GET
/v1/metrics/prometheus
Prometheus text format
POST
/v1/knowledge/upload
Upload file → parse → chunk → embed
POST
/v1/knowledge/ingest
Ingest raw text → chunk → embed
GET
/v1/knowledge/documents
List documents per tenant
GET
/v1/knowledge/documents/{id}
Document metadata
DELETE
/v1/knowledge/documents/{id}
Delete document and chunks
PUT
/v1/knowledge/documents/{id}
Re-ingest updated content
GET
/v1/knowledge/search
Test retrieval quality
POST
/v1/knowledge/tune-embeddings
Fine-tune embeddings on ingested docs
Exceptions
Exception
Module
DirectorAIError
core.exceptions
CoherenceError
core.exceptions
KernelHaltError
core.exceptions
GeneratorError
core.exceptions
ValidationError
core.exceptions
DependencyError
core.exceptions
HallucinationError
core.exceptions
NumericalError
core.exceptions
PhysicsError
core.exceptions
Removed Aliases (v3.0.0)
All 1.x deprecated aliases were removed in v3.0.0. See CHANGELOG for migration.