Literature Evidence Graph
Turn the supplied papers into a queryable graph without adding facts from prior knowledge. The Agent performs semantic reading; the bundled stdlib Python tool indexes paragraphs, verifies quotations, exports the graph, and executes queries. No network or third-party package is required.
Required workflow
-
Read the actual contract and materials. Inspect
/input/case.json,/input/task.md,corpus-manifest.json, the paper files, and any original output contract. Record the exactcase_id, every originaloutput_contractfield and its type, requested entity/relation types, and requested queries. Treat rootDOI,title, andauthorsas belonging only to the primary paper. Read the secondary paper's own manifest entry and text. Do not treat two formats of one paper as two papers. -
Save an honest partial result early. Under
/app/output, createresult.jsonwith the original contract fields andcase_id; usepartial/the contract's equivalent with the current limitation, never placeholder success. Work in/app/work. Keep all final artifacts in/app/output. -
Index the paragraphs. Resolve this Skill's actual installation directory as
SKILL_DIR(the platform uses/skills/weekly-skill), then run:python3 "$SKILL_DIR/scripts/graph_tool.py" index --input-dir /input --output /app/work/material-index.jsonRead the original papers for interpretation; use the index to obtain exact
source_id,paragraph_id, and quotation text. These are organization-supplied JATS paragraph IDs, not PDF page numbers. If one file is unreadable, the index preserves the other readable paper and records the failure. Continue with a reducedpartialcandidate rather than losing the readable graph. If no usable indexed paragraphs remain, retain the partial result and identify the parser/material blockage; do not invent locators or manufactured index entries. -
Create the candidate graph. Read
references/graph-format.mdand write/app/work/candidate.json.assets/synthetic-candidate.jsonshows structure only; never copy its scientific content into a real result. For a complete run, include both papers, all task-required entities and supported relations, alignments, conflicts/different-object decisions, uncertainties, changes, and at least three queries fromtask.md(or scientifically meaningful queries when none are specified). For a partial run, include known metadata for each supplied paper, set the affected paper'savailabilitytomissingorunreadable, retain only evidence-backed nodes/edges from readable sources, explain the exact takeover point, and execute at least three meaningful queries on the available graph. -
Validate, export, and execute all queries. Use an empty or versioned output location so stale artifacts cannot be mistaken for current results:
python3 "$SKILL_DIR/scripts/graph_tool.py" build --candidate /app/work/candidate.json --index /app/work/material-index.json --output-dir /app/outputIf a real prior graph is supplied, add
--previous-graph /path/to/prior-graph.jsonand preserve unchanged node/edge IDs. A nonzero exit means the graph is not validated: read/app/output/validation.json, fix only evidenced candidate errors, and rerun. If the remaining problem is source/tool availability, retain the honest partial outputs instead of bypassing validation. -
Finish and check the original result contract. Update
/app/output/result.jsonfrom the validated graph, executedquery-results.json, andvalidation.json; do not replace original fields with a generic schema or change their types. Include the main graph, evidence/source locations, run status, uncertainties, and changes in the prescribed fields. Put additional detail in the graph artifacts if the contract is closed. Ensurequeriesin the result reflect actual returned subgraphs and evidence, not paraphrased unsupported answers. Then run the deterministic contract check:python3 "$SKILL_DIR/scripts/graph_tool.py" check-result --case /input/case.json --result /app/output/result.json --graph /app/output/graph.json --queries /app/output/query-results.json --validation /app/output/validation.json --output /app/output/final-validation.jsonA nonzero exit means the final contract is not verified; correct the concrete field/status/query mismatch and rerun. The checker does not judge scientific correctness or query relevance.
Scientific constraints
- Every substantive node and edge needs at least one evidence object with an independent paper
source_id, exactparagraph_id, and a short contiguous original quotation. Keep distinct evidence items for distinct papers. Do not use a generated page number, another paper's metadata, or an unverifiable summary as evidence. - Extract actual researchers, materials, methods, tasks, metrics, findings, and other requested objects. Use source wording for labels/aliases where practical. A label may be clarified for readability, but the quotation must establish the underlying object.
- Create an edge only when the text supports its subject, predicate, object, direction, claim mode, and conditions. Co-occurrence is insufficient. Distinguish direct author claims, secondary reports about cited work, hypotheses, and negations. Do not silently convert a review attribution into the current paper's experimental result.
- Keep conditions, samples, model instances, datasets, and numerical results scoped to their paper and experiment. Never merge different physical samples or combine different studies' conditions/numbers into one conclusion. Shared generic method/material terminology alone does not establish identity.
- For each plausible cross-paper alignment, compare explicit abbreviation/full-name links, definitions, identifiers, and context. Record
merged,kept_separate, orundeterminedwith evidence. Case folding and punctuation normalization are search aids, not proof of identity. Preserve contradictory assertions as separate edges plus a conflict record; never average or choose a winner without evidence. - Preserve unreported items and source-internal conflicts in
uncertainties/conflicts. A query with no matching assertion means no graph result, not proof that the papers deny the relation.
Queries and outputs
The tool supports search_nodes, neighbors, paths, and find_relations. Execute at least three task-relevant queries. Each returned query includes answered, no_result, or ambiguous status, matches, and a result subgraph containing full evidence. For ambiguous anchors, inspect all candidates rather than silently selecting one. Add the scientific answer in result.json only by interpreting these returned matches and their conditions.
A validated build produces:
graph.json,graph.graphml, andgraph.md: complete graph and readable exports;query-results.jsonandquery-results.md: all executed queries with evidence-bound subgraphs;validation.json: counts, warnings/errors, and executed-query count;final-validation.json: original-contract field/type, case identity, status, and query exposure checks.
result.json remains necessary even when these files exist. A result is success only when the required materials were read, required coverage is present, every substantive node/edge passed evidence validation, at least three queries actually ran, and no required task component remains unresolved. Otherwise use partial, unable_to_judge, or the exact contract status and identify the concrete missing file, unreadable paragraph, unresolved identity, or absent evidence.
Before finishing, verify that both paper identities are correct, both are represented by evidence, quotations are original and contiguous, no condition/source was mixed, all three query results contain their supporting subgraphs, and the change log describes actions actually performed. The visible response should state status, output paths, node/edge/query counts, and specific limitations.