|
| 1 | += Bofig Cartridge |
| 2 | +:toc: preamble |
| 3 | +:author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 4 | +:date: 2026-04-25 |
| 5 | +:spdx: PMPL-1.0-or-later |
| 6 | + |
| 7 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 8 | + |
| 9 | +Evidence graph query interface for investigative journalism workflows — search evidence, find connections, analyze relationships in complex networks. |
| 10 | + |
| 11 | +== Features |
| 12 | + |
| 13 | +- **Evidence Queries** — Retrieve evidence by ID with metadata (source, confidence, date) |
| 14 | +- **Keyword Search** — Search evidence across documents, interviews, datasets, media |
| 15 | +- **Connection Discovery** — Find relationships and connections between entities |
| 16 | +- **Path Analysis** — Shortest path finding between entities in the graph |
| 17 | +- **Custom Queries** — Execute graph queries (Cypher-like syntax) |
| 18 | +- **Graph Analytics** — Get statistics on nodes and edges |
| 19 | + |
| 20 | +== Architecture |
| 21 | + |
| 22 | +[cols="1,3"] |
| 23 | +|=== |
| 24 | +| Component | Purpose |
| 25 | + |
| 26 | +| `abi/Bofig.idr` |
| 27 | +| Idris2 interface with evidence types (Document, Interview, Dataset, Analysis, Media, Archive) |
| 28 | + and connection/relationship definitions. |
| 29 | + |
| 30 | +| `ffi/bofig_ffi.zig` |
| 31 | +| Zig bindings for evidence graph database queries. |
| 32 | + |
| 33 | +| `adapter/mod.ts` |
| 34 | +| Deno MCP server exposing evidence-graph tools. |
| 35 | + Runs on `127.0.0.1:5178` (loopback only). |
| 36 | + |
| 37 | +| `cartridge.json` |
| 38 | +| Tool manifest with 6 MCP tools for evidence analysis. |
| 39 | +|=== |
| 40 | + |
| 41 | +== MCP Tools |
| 42 | + |
| 43 | +=== `query_evidence` |
| 44 | +Retrieve evidence record by ID with full metadata (source type, confidence level, date collected, description). |
| 45 | + |
| 46 | +=== `search_evidence` |
| 47 | +Search evidence by keyword across all fields (titles, descriptions, source types, content). |
| 48 | + |
| 49 | +=== `get_connections` |
| 50 | +Retrieve all relationships and connections for an entity in the evidence graph. |
| 51 | + |
| 52 | +=== `find_path` |
| 53 | +Compute shortest path between two entities, useful for analyzing degrees of separation. |
| 54 | + |
| 55 | +=== `execute_query` |
| 56 | +Execute custom graph query using graph query syntax (similar to Cypher). |
| 57 | + |
| 58 | +=== `get_graph_stats` |
| 59 | +Retrieve overall statistics: total nodes, total edges, last updated timestamp. |
| 60 | + |
| 61 | +== Integration |
| 62 | + |
| 63 | +Connects to bofig (evidence graph) via: |
| 64 | +- **Evidence database** for record storage and retrieval |
| 65 | +- **Relationship index** for connection queries |
| 66 | +- **Graph algorithms** for path finding and analysis |
| 67 | +- **Search engine** for full-text evidence discovery |
| 68 | + |
| 69 | +Loopback proof pinning: `IsLoopback 5178` at compile-time. |
| 70 | + |
| 71 | +== Use Cases |
| 72 | + |
| 73 | +- **Investigative Research** — Discover connections and relationships in complex networks |
| 74 | +- **Fact Checking** — Trace evidence chains and corroboration paths |
| 75 | +- **Narrative Analysis** — Identify key entities and relationship patterns |
| 76 | +- **Story Development** — Build and validate investigative narratives |
| 77 | + |
| 78 | +== License |
| 79 | + |
| 80 | +PMPL-1.0-or-later (MPL-2.0 legal fallback). |
0 commit comments