MCPcopy Create free account
hub / github.com/LLMQuant/quant-mind / PaperKnowledgeCard

Class PaperKnowledgeCard

quantmind/knowledge/paper.py:34–52  ·  view source on GitHub ↗

Distilled summary card of a `Paper`. The store layer keys this off ``paper_id`` so the card and its tree can be retrieved together. The card is the right shape for tagging, filtering, and dashboard surfaces; deep questions go to the tree.

Source from the content-addressed store, hash-verified

32
33 CHUNK_SET = "paper_chunk_set"
34 GLOBAL_SUMMARY = "paper_summary"
35 STRUCTURE_TREE = "paper_structure_tree"
36
37
38def _stable_hash(value: object) -> str:
39 """Return a deterministic SHA-256 hash for one JSON-compatible value."""
40 payload = json.dumps(
41 value,
42 ensure_ascii=False,
43 separators=(",", ":"),
44 sort_keys=True,
45 )
46 return hashlib.sha256(payload.encode("utf-8")).hexdigest()
47
48
49def _text_hash(value: str) -> str:
50 return hashlib.sha256(value.encode("utf-8")).hexdigest()
51
52
53def _paper_source_id(content_hash: str) -> UUID:
54 return uuid5(NAMESPACE_URL, f"quantmind:paper-source:{content_hash}")
55

Callers 4

test_minimalMethod · 0.90
test_fullMethod · 0.90
test_embedding_textMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_minimalMethod · 0.72
test_fullMethod · 0.72
test_embedding_textMethod · 0.72