Architecture
On this page
There is no CLI, web server, ORM, or plugin-discovery mechanism in this package. Extensibility is achieved through plain constructor injection (e.g. passing a custom ContextManager or extra Guardrail objects into PromptEngine) and the STRATEGY_REGISTRY dict.
Module dependency graph
ab_testing.py is the one module with no import dependency on the rest of the package — it operates on plain strings and an injected llm object, and only optionally introspects a rag_system via getattr/hasattr at runtime (see api/ab_testing).
Request lifecycle: PromptEngine.build()
Class relationships
Extension points
[!WARNING] Unused integration handles
memory_store,cache_store, androuterare accepted and stored byPromptEngine.__init__, but no method inprompt_enginereads them. Documenting them as functional would be speculative; treat them as forward-declared extension slots until their consumers appear in the codebase.
Initialization order
PromptEngine.__init__builds aGuardrailEngine(usingguardrail_engineif given, else a new one seeded withextra_guardrails).- It builds a
PromptBuilder, passing incontext_manager(or a newContextManager()) and the guardrail engine. - State containers are initialized:
_metrics(PromptMetrics),_cache(dict),_feedback(list),_hooks(defaultdict(list)),_trace_log(list). - No I/O, network calls, or file reads happen during construction — everything is in-memory.