PowerContext Source Importer
Turn flat files into per-record evidence so every retrieval hit can be traced back to an exact row or event.
<!-- OB-S:fsXw4Y-6Js_bAWwYxFA70Q -->When to use
- A CSV report must be searchable per row, keyed by a business key.
- A JSONL session log (agent traces, audit trails) must keep one Source per event.
- Reviews demand a citation that resolves to the original record, byte for byte.
Workflow
- Inspect the file. Read the header line; confirm the primary key column exists, is non-blank, and is unique per document.
- Parse strictly. Decode as UTF-8 (accept a leading BOM). Use strict CSV quoting:
comma separator,
"quote,""escape. Reject duplicates, blank keys, wrong widths. - Build one Source per record. Identity depends only on document identity plus the record key, so re-imports stay idempotent and revisions get new identities.
- Project to text evidence. Content is a compact JSON object of the row (or the event body); metadata keeps document id, key, and record identity.
- Persist through the runtime. Submit observations via the ingestion API; a repeat submission of the same identity must not create a second Source.
- Verify citations. Run a query, resolve each hit, and confirm the cited text equals the projected content and that coordinates match the original record.
Rules
- Never rewrite, translate, or summarise record content into the evidence text.
- Reject the whole document on any parse error; never emit partial rows.
- Keep identities under 256 characters and delimiter-safe (percent-encode separators).
Scan to join WeChat group