Skip to content

build_graph_from_pdf() fails in FalkorDB/FalkorDB Lite graph_writer with parameterized Cypher errors ($id, #7

@NEWbie0709

Description

@NEWbie0709

retrico.build_graph_from_pdf() works for some PDFs but fails for others during graph_writer when using FalkorDB.

After additional debugging, the issue does not appear to be limited to a specific text payload field. The failures occur across multiple writer methods and consistently point to parameterized Cypher placeholders like $id / $entity_id.

This looks more like a FalkorDB parameterized-query compatibility issue than a pure PDF parsing issue.

### Environment

- Python 3.12
- `retrico` installed in conda environment
- backend: `store_type="falkordb_lite"`
- tested on April 1, 2026
- GPU/CPU setting does not seem to change the failure mode

### Minimal code

```python
import retrico
from pathlib import Path

PDF_PATHS = [str(p) for p in Path("pdf_folder").glob("*.pdf")]

ENTITY_LABELS = [
    "person",
    "organization",
    "location",
    "asset",
    "money",
]

RELATION_LABELS = [
    "works_for",
    "owns",
    "located_in",
    "part_of",
    "family",
    "has_value",
]

retrico.build_graph_from_pdf(
    pdf_paths=PDF_PATHS,
    entity_labels=ENTITY_LABELS,
    relation_labels=RELATION_LABELS,
    extract_text=True,
    extract_tables=False,
    device="cuda",
    store_type="falkordb_lite",
)

What I observed
I tested PDFs one-by-one.

Total PDFs tested: 28
Succeeded: 17
Failed: 11

Example errors
RuntimeError: Node 'graph_writer' failed: errMsg: Invalid input at end of input: expected '=' ... errCtx: CYPHER id
redis.exceptions.ResponseError: errMsg: Invalid input at end of input: expected '=' ... errCtx: CYPHER entity_id

can i know whats the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions