원클릭으로
wittsrc-query
混合搜索:结合向量检索(pgvector)、关键词检索(tsvector)和 Reciprocal Rank Fusion(RRF), 对 Wittgenstein Brain 进行多层检索。支持意图分类、多查询扩展、编译真理提升。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
混合搜索:结合向量检索(pgvector)、关键词检索(tsvector)和 Reciprocal Rank Fusion(RRF), 对 Wittgenstein Brain 进行多层检索。支持意图分类、多查询扩展、编译真理提升。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
对 Brain Pages 执行分级实体富化。 Tier 3(单次提及)→ Tier 2(3次提及或跨来源)→ Tier 1(8次提及或核心人物/概念)。 从 SEP/IEP 百科、Gutenberg 简介中提取补充信息。
知识图谱遍历:基于抽取的 typed links(cites/evolves_to/contradicts/influenced_by) 执行递归图查询。回答关系型问题,如"Ms-114 和 Ms-152 之间有什么关系"、 "语言游戏概念是如何演变的"。
将 Wittgenstein 语料(WittSrc/Clarino/Gutenberg)导入 Brain Pages。 识别文件类型,按规则路由到 brain/ 目录(works/concepts/people/timelines), 执行 chunking、embedding 和去重。
零 LLM 抽取 Wittgenstein 文本中的实体引用,生成 typed links 构建知识图谱。 通过正则匹配手稿编号、人名、哲学概念,生成 cites/evolves_to/contradicts/influenced_by 关系。
维护 Brain 健康状态:检查孤儿页(无入链)、死链接(目标不存在)、 过期页(90天未更新)、引用审计和标签一致性。
Wittgenstein Brain — 给维特根斯坦 Persona 专用的记忆系统。 将 Wittgenstein 学术语料(WittSrc/Clarino/Gutenberg)转化为可查询、可链接、可追踪的 Brain Pages, 并通过混合搜索 + 知识图谱为蒸馏流水线提供知识检索能力。 使用当用户想要: - 将 Wittgenstein 手稿语料导入 Brain - 查询某个哲学概念在手稿中的演变 - 生成手稿间引用关系图 - 为 Wittgenstein Persona 提供知识检索 - 从语料中提取实体(人名/概念/手稿编号)
| name | wittsrc-query |
| version | 1.0.0 |
| description | 混合搜索:结合向量检索(pgvector)、关键词检索(tsvector)和 Reciprocal Rank Fusion(RRF), 对 Wittgenstein Brain 进行多层检索。支持意图分类、多查询扩展、编译真理提升。 |
| triggers | ["查询维特根斯坦","search wittgenstein","问.*什么","关于.*说了什么","query brain","检索"] |
| tools | ["wittsrc-query"] |
| mutating | false |
对 Wittgenstein Brain 执行混合检索,返回最相关的 Brain Pages 和文本段落。
用户问题
│
▼
Intent Classifier
├─ entity: "Who mentioned Russell?" → graph-first
├─ temporal: "When did Wittgenstein discuss language games?" → timeline-first
├─ conceptual: "What is the private language argument?" → hybrid-search
└─ general: "What did Wittgenstein say about X?" → hybrid-search
│
▼
Multi-Query Expansion (Haiku)
生成 3 个改写版本:
- "What does Wittgenstein think about X?"
- "Wittgenstein's view on X"
- "X in Wittgenstein's philosophy"
│
▼
Parallel Search
┌─ Vector Search (HNSW cosine, k=20)
└─ Keyword Search (tsvector, k=20)
│
▼
RRF Fusion
score = Σ(1 / (60 + rank_i))
│
▼
Cosine Re-ranking
对 RRF 结果用 query embedding 重新计算余弦相似度
│
▼
Compiled Truth Boost
如果 chunk 来自 "compiled truth" 区域(--- 前),boost ×1.5
│
▼
Dedup (4-layer)
1. 同 slug 只保留 top chunk
2. 相似 slug 合并(Ms-114 ≈ Ms-114_Clarino-CC)
3. 来源多样性(不同手稿优先)
4. Compiled truth 唯一性保证
│
▼
结果 + 引用
type Intent = 'entity' | 'temporal' | 'conceptual' | 'general';
const INTENT_RULES = [
{ pattern: /^who (?:talked|mentioned|discussed|cited|corresponded with)/i, intent: 'entity' },
{ pattern: /^when (?:did|was|were)/i, intent: 'temporal' },
{ pattern: /(?:what is|definition of|meaning of|explain) \w+/i, intent: 'conceptual' },
{ pattern: /(?:what did|say about|think about|view of|opinion on)/i, intent: 'general' },
{ pattern: /(?:contradict|opposite|conflict)/i, intent: 'conceptual' },
{ pattern: /(?:evolution|development|change over time|earlier|later) \w+/i, intent: 'temporal' },
];
# 基础检索
bun run scripts/wittsrc-query.ts "What did Wittgenstein say about language games?"
# 指定类型过滤
bun run scripts/wittsrc-query.ts "private language" --type concept
# 带上下文窗口
bun run scripts/wittsrc-query.ts "rule following" --context-window 3
# 只返回编译真理区域
bun run scripts/wittsrc-query.ts "family resemblance" --compiled-truth-only
{
"query": "What did Wittgenstein say about language games?",
"intent": "general",
"rewrites": [
"Wittgenstein's view on language games",
"language games in Wittgenstein's philosophy",
"Wittgenstein language game definition"
],
"results": [
{
"rank": 1,
"slug": "concept-language-game",
"title": "Language Game",
"type": "concept",
"score": 0.94,
"chunk": "The term 'language game' is used by Wittgenstein...",
"source": "PI §1",
"compiledTruth": true,
"period": [1930, 1951]
}
],
"timing": {
"total": 127,
"vectorSearch": 45,
"keywordSearch": 12,
"rerank": 70
}
}
# 自动问答比对
bun run scripts/wittsrc-query.ts "$QUESTION" --format comparison
# 输出:
# - 检索到的最相关段落
# - 期望的 Wittgenstein 回答特征
# - 比对结果(匹配度评分)
# 查询某个概念的所有相关段落
bun run scripts/wittsrc-query.ts "rule following" --all-chunks --format timeline
# 输出按时间排序的概念讨论演变
people/person-russell.md)