Advanced Prompting Engine
高级提示词引擎
一个以 MCP 服务器形式提供的通用提示词创建引擎。它在 12 个哲学维度上衡量意图,并返回一个构建基础,客户端可据此构建提示词。
该引擎本身不生成提示词。它提供维度基础——主动构建、光谱对立、张力、核心要素 (gems)、分支 (spokes)、协调对和构建问题——使提示词构建变得有据可依,而非仅仅依赖启发式方法。
快速入门
# Install
pip install advanced-prompting-engine
# Or run directly via uvx
uvx advanced-prompting-engineMCP 配置
添加到你的 .mcp.json 中:
{
"mcpServers": {
"advanced-prompting-engine": {
"command": "uvx",
"args": ["advanced-prompting-engine"]
}
}
}功能说明
该引擎将你的意图定位在一个 12 维的哲学流形中:
面 | 子维度 | 阶段 |
本体论 | 特殊 ↔ 普遍,静态 ↔ 动态 | 理解 |
认识论 | 经验 ↔ 理性,确定 ↔ 临时 | 理解 |
价值论 | 绝对 ↔ 相对,定量 ↔ 定性 | 理解 |
目的论 | 即时 ↔ 终极,意图 ↔ 涌现 | 理解 |
现象学 | 客观 ↔ 主观,表面 ↔ 深度 | 理解 |
伦理学 | 义务论 ↔ 后果论,主体 ↔ 行为 | 评估 |
美学 | 自主 ↔ 情境,感官 ↔ 概念 | 评估 |
实践论 | 个人 ↔ 协调,反应 ↔ 主动 | 应用 |
方法论 | 分析 ↔ 综合,演绎 ↔ 归纳 | 应用 |
符号学 | 显性 ↔ 隐性,句法 ↔ 语义 | 应用 |
诠释学 | 字面 ↔ 比喻,作者意图 ↔ 读者反应 | 应用 |
启发法 | 系统 ↔ 直觉,保守 ↔ 探索 | 应用 |
每个面都是一个 12x12 的网格,包含 144 个认知观察点。位置决定了分类(角/中点/边/中心)、效能和光谱归属。这 12 个面被组织为 6 个互补对(立方体模型),并通过共享表面进行协调。引擎通过位置对应关系计算张力、通过立方体层级调制计算核心要素(跨面整合)、通过分支(每面的行为特征)以及中心核心要素的一致性得分。
工具
工具 | 用途 |
| 主要工具 — 输入意图或坐标,输出构建基础 |
| 解释 — 以通俗语言解读构建基础 |
| 专家工具 — 图遍历、压力测试、三角测量 |
| 创作 — 添加带有矛盾检测的构建和关系 |
示例:自然语言意图
create_prompt_basis(intent="Design an ethical framework for autonomous vehicle decision-making")引擎在所有 12 个哲学维度上定位此意图并返回:
{
"coordinate": {
"epistemology": {"x": 4, "y": 4, "weight": 0.76},
"ontology": {"x": 6, "y": 5, "weight": 0.73},
"praxeology": {"x": 7, "y": 4, "weight": 0.72},
"heuristics": {"x": 5, "y": 3, "weight": 0.66},
"phenomenology": {"x": 7, "y": 4, "weight": 0.61},
"ethics": {"x": 6, "y": 4, "weight": 0.53},
"...": "...all 12 faces with (x,y) position and relevance weight"
},
"harmonization": [
{"pair": ["ontology", "praxeology"], "resonance": 0.15},
{"pair": ["axiology", "ethics"], "resonance": 0.05},
"...6 complementary pairs with resonance scores"
],
"spokes": {
"ontology": {"classification": "weakly_integrated", "strength": 0.042},
"epistemology": {"classification": "weakly_integrated", "strength": 0.039},
"...": "...per-face behavioral signatures"
},
"central_gem": {"coherence": 0.69, "classification": "highly_coherent"},
"construction_questions": {
"ethics": {
"template": "What moral obligations does this prompt impose or assume?",
"position_summary": "balanced Deontological/Consequential + moderately Agent-focused",
"meaning_mechanism": "composition",
"phase": "evaluation"
},
"...": "...12 position-specific philosophical questions to guide prompt construction"
}
}输出告诉你:此意图主要关于知识验证(认识论 0.76)、实体存在(本体论 0.73)和行动结构(实践论 0.72)。伦理学得分为 0.53 — 存在但非主导。协调性显示本体论和实践论产生了强烈的共鸣(0.15)——理论上的“存在什么”与实践上的“如何行动”相一致。
示例:预设坐标
为了精确控制,可以直接传递坐标:
coordinate = {
"ontology": {"x": 0, "y": 0, "weight": 1.0}, # corner: particular + static
"ethics": {"x": 0, "y": 11, "weight": 0.9}, # corner: deontological + act
"methodology": {"x": 0, "y": 0, "weight": 0.8}, # corner: analytic + deductive
# ...all 12 faces with x (0-11), y (0-11), weight (0-1)
}
result = create_prompt_basis(coordinate=coordinate)架构
技术栈: Python + NetworkX (拓扑) + numpy (计算) + SQLite (持久化) + MCP SDK
图结构: 1873 个节点,2279 条边(12 个面 × 144 个构建 + 132 个连接点 + 1 个中心核心要素)
流水线: 8 个阶段(意图解析器 → 坐标解析器 → 位置计算器 → 构建解析器 → 张力分析器 → 连接点/核心要素分析器 → 分支分析器 → 构建桥接器)
几何: 以向量平衡(立方八面体)作为潜在的跨面拓扑,以立方体模型作为 6 个互补对的结构
部署: 单进程,stdio 传输,无守护进程,无外部依赖
文档
docs/DESIGN.md— 完整设计规范docs/CONSTRUCT-v2.md— 构建规范(面、点、光谱、连接点、核心要素、分支的定义)docs/CONSTRUCT-v2-questions.md— 按区域划分的 144 个构建问题模板docs/adr/— 13 份架构决策记录
开发
pip install -e ".[dev]"
pytest tests/ -v重建语义桥(可选)
发布的包中包含预计算的 BGE 派生工件(semantic_bridge.npz, semantic_vocab.json)。若要从头开始重建它们(例如在修改极点同义词后),请安装构建扩展:
pip install -e ".[build]"
python -m nltk.downloader wordnet omw-1.4
python scripts/build_semantic_bridge.py构建过程使用 BAAI/bge-large-en-v1.5(约 1.3 GB,下载一次至 HuggingFace 缓存)和 wordfreq 进行频率排序。运行时依赖项不受影响 — 最终用户仅接收预计算的工件。
贡献
请参阅 CONTRIBUTING.md 获取开发设置和指南。
安全
请参阅 SECURITY.md 获取漏洞报告说明。
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JoshuaRamirez/advanced-prompting-engine'
If you have feedback or need assistance with the MCP directory API, please join our Discord server