Commit graph

20 commits

Author SHA1 Message Date
cybermaggedon
bdfdbb3c1f
feat: add Docling-based document decoder as alternative to unstructured (#1054)
Add trustgraph-docling package providing a document decoder powered by
IBM's Docling library. Supports PDF, DOCX, XLSX, PPTX, HTML, Markdown,
and CSV with two chunking modes:

- page mode (default): groups output by page for page-based formats,
  emits TextDocument messages for the existing downstream chunker
- hybrid mode: uses Docling's HybridChunker for structure-aware
  semantic chunking, emits Chunk messages directly

Tables are preserved as HTML markup. Images are stored in the librarian
with provenance but excluded from the text pipeline. Full provenance
chain is maintained for explainability tracing.

Includes Containerfile, CI/CD integration (PR checks and release
workflows), Makefile targets, and tech spec documentation.

Added unit tests for the package.
2026-07-20 21:25:33 +01:00
cybermaggedon
6b1dd16f9f
fix: large document handling and Cassandra query pagination (#969)
- Paginate heavy Cassandra reads (triples, graph/document embeddings)
  using synchronous session.execute() in run_in_executor with fetch_size
  paging, preventing materialization hang on large result sets
- Fix document stream endpoint to use workspace-scoped librarian queues
- Add decoder error handling for PDF/OCR/unstructured processors
- Add WebSocket mux guards for missing auth fields
- Add null check in librarian document streaming
- Rewrite get_document_content CLI to stream via librarian
- Add Poppler dependency to unstructured container
2026-06-01 22:39:30 +01:00
cybermaggedon
a92dfa0b8a Fix HF build issue (#958)
Added click to the pip install line. Looks like huggingface-hub 1.13.0
added a CLI dependency on click but didn't declare it as a hard
requirement (or it's only required for the CLI entrypoint). Needed to
unblock the build.
2026-05-28 11:23:46 +01:00
cybermaggedon
9be257ceee
Update packages with vulns in container builds (#861)
* Fix vulns-flagged imports

* Fix archaic pulls in the "trustgraph" package

* Add unstructured to meta package
2026-04-30 20:02:53 +01:00
cybermaggedon
5108b3db95
Get hf onto Python 3.12 so that it works on AMD64 and ARM64 (#802) 2026-04-13 21:49:59 +01:00
cybermaggedon
3af794ceea
Use manifests to build for amd64 and arm64 (#798) (#801)
Remove Pytorch +cpu invocation, so it builds on ARM
2026-04-13 21:18:58 +01:00
cybermaggedon
413f917676 Add missing pdf extra to unstructured dependency (#728)
* Fix PDF processing deps so that PDF processing works
2026-03-29 20:22:45 +01:00
cybermaggedon
5c6fe90fe2
Add universal document decoder with multi-format support (#705)
Add universal document decoder with multi-format support
using 'unstructured'.

New universal decoder service powered by the unstructured
library, handling DOCX, XLSX, PPTX, HTML, Markdown, CSV, RTF,
ODT, EPUB and more through a single service. Tables are preserved
as HTML markup for better downstream extraction. Images are
stored in the librarian but excluded from the text
pipeline. Configurable section grouping strategies
(whole-document, heading, element-type, count, size) for non-page
formats. Page-based formats (PDF, PPTX, XLSX) are automatically
grouped by page.

All four decoders (PDF, Mistral OCR, Tesseract OCR, universal)
now share the "document-decoder" ident so they are
interchangeable.  PDF-only decoders fetch document metadata to
check MIME type and gracefully skip unsupported formats.

Librarian changes: removed MIME type whitelist validation so any
document format can be ingested. Simplified routing so text/plain
goes to text-load and everything else goes to document-load.
Removed dual inline/streaming data paths — documents always use
document_id for content retrieval.

New provenance entity types (tg:Section, tg:Image) and metadata
predicates (tg:elementTypes, tg:tableCount, tg:imageCount) for
richer explainability.

Universal decoder is in its own package (trustgraph-unstructured)
and container image (trustgraph-unstructured).
2026-03-23 12:56:35 +00:00
cybermaggedon
08063a5ee9
Remove unused deps (#640)
* Removed the Google GenAI hard-coded install
2026-02-20 10:13:44 +00:00
cybermaggedon
05b9063fea
Feature/python3.13 (#553)
* Python to 3.13

* cassandra-driver -> scylla-driver
  (cassandra-driver doesn't work with Python 3.13)
2025-10-11 12:19:26 +01:00
cybermaggedon
98022d6af4
Migrate from setup.py to pyproject.toml (#440)
* Converted setup.py to pyproject.toml

* Modern package infrastructure as recommended by py docs
2025-07-23 21:22:08 +01:00
cybermaggedon
f907ea7db8
PoC MCP server (#419)
* Very initial MCP server PoC for TrustGraph

* Put service on port 8000

* Add MCP container and packages to buildout
2025-07-02 18:19:23 +01:00
cybermaggedon
81d73445bd
Add missing dependencies to the PDF OCR container (#411) 2025-06-16 14:15:16 +01:00
cybermaggedon
448819ed47
Updates to Google AI: (#394)
- Changed GoogleAIStudio LLM code to match latest documentation
- Very minor tweak to vertexai LLM code - just matching what's in SDK docs
  no actual change to implementation.
- Tweaked VertexAI container build to speed up in dev
- Comments in LLM code to mention which docs it was built from.  Google
  SDKs are confusing ATM.
2025-05-24 12:09:43 +01:00
cybermaggedon
b380c2054d
Change containers to Python 3.12 (#386) 2025-05-17 23:15:29 +01:00
cybermaggedon
e04d3631fd
Update container deps (#385)
- Fedora 42 container
- Pulsar client 3.7.0
- Latest AI libs
2025-05-17 20:54:56 +01:00
cybermaggedon
322725be04
Fix container build (#325) 2025-03-20 09:38:54 +00:00
cybermaggedon
c759d55734
Added module which does OCR for PDF, pdf-ocr in a separate package (#324)
(has a lot of dependencies).  Uses Tesseract.
2025-03-20 09:29:40 +00:00
JackColquitt
d676804107 Added Mistral jsonnet templates 2025-03-14 18:07:51 -07:00
cybermaggedon
edcdc4d59d
Feature/separate containers (#287)
* Separate containerfiles

* Add push to Makefile

* Update image names in the templates
2025-01-28 19:36:05 +00:00