Versioned prompt registry with semantic search, hashing, and audit trail
Project description
ghostprompt
Versioned prompt registry with semantic search, SHA-256 hashing, and audit trail.
Store prompts by name, pull with variable substitution, search by meaning. Every pull is hashed and logged — optionally sealed to Blackbox via ghostseal.
Install
pip install ghostprompt
Usage
from ghostprompt import PromptRegistry
registry = PromptRegistry()
# Store prompts
registry.store("evaluate_code", "Evaluate this {{language}} code:\n{{code}}", tags=["eval", "code"])
registry.store("write_summary", "Summarize the following in {{length}} words:\n{{text}}", tags=["writing"])
# Pull with variables — returns rendered text + metadata
text, meta = registry.pull("evaluate_code", variables={"language": "Python", "code": "x = 1"})
# text = "Evaluate this Python code:\nx = 1"
# meta.hash = "sha256:a1b2c3..." (hash of rendered text)
# meta.version = 1
# Search by meaning (requires Ollama with nomic-embed-text)
results = registry.search("code evaluation prompt")
# [("evaluate_code", 0.92), ...]
# Version tracking — templates auto-increment on change
registry.store("evaluate_code", "Review this {{language}} code:\n{{code}}")
info = registry.get("evaluate_code")
# info["version"] = 2
With spine + ghostseal (full audit chain)
from spine import Core
from ghostseal import SealClient
from ghostprompt import PromptRegistry
def setup(c):
audit = SealClient(blackbox_url="https://blackbox:8443", api_key="...")
prompts = PromptRegistry(audit=audit)
prompts.store("evaluate_code", "Evaluate this {{language}} code:\n{{code}}")
c.register("audit", audit)
c.register("prompts", prompts)
c.boot(env="prod")
Core.boot_once(setup)
# Any file:
prompts = Core.instance().get("prompts")
text, meta = prompts.pull("evaluate_code", variables={"language": "Python", "code": "..."})
# → ghostseal emits "ghostprompt.pull" with prompt_name, version, content_hash
# → Blackbox seals it into a hash-chained capsule
Semantic search
Requires Ollama running locally with an embedding model:
ollama pull nomic-embed-text
from ghostprompt import PromptRegistry
from ghostprompt.embedder import Embedder
registry = PromptRegistry(embedder=Embedder())
registry.store("assess_technical_v4", "Evaluate the {{domain}} work...", tags=["evaluation"])
# Search by meaning, not name
results = registry.search("code evaluation prompt")
# [("assess_technical_v4", 0.91)]
Falls back to text substring matching if Ollama isn't available.
Part of the GhostLogic SDK
maelspine → config registry
ghostseal → audit backbone
ghostprompt → prompt management (this package)
ghostrouter → LLM routing
ghostserver → MCP tools
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghostprompt-0.1.0.tar.gz.
File metadata
- Download URL: ghostprompt-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf707a125b20cb4f1f5a1e3775621a40a242cd5f674b5fabfe8f7c506e5dd82e
|
|
| MD5 |
6b44d2433eafef75d6168a79ce496389
|
|
| BLAKE2b-256 |
0902b66f1762d1da46449e04ec1ea220684b61f24426e427845c6a5b2f3a0660
|
File details
Details for the file ghostprompt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ghostprompt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2e1616c994f6716c54a7d35834c1f605ec2beef15575a017bc335a6631f9487
|
|
| MD5 |
764725683b60265874deac97eb7af973
|
|
| BLAKE2b-256 |
05373707beaf3f7f363e3159f16a7635a5242a3b24669adbfa7027fd3668c0fd
|