Skip to content

Size of schema serialization can be optimized #181

@jordi-mas-dj

Description

@jordi-mas-dj

Environment details

  • OS type and version:
  • Python version: 3.13.3
  • pip version: 25.1.1
  • langchain-google-spanner version: 0.82

Steps to reproduce

See PR: #182

Right now, when the schema is serialized looks like:

"Node properties per node label": { "FiscalPeriodKeyFigures": [ { "property name": "diluted_epsexcluding_extrordinary_items", "property type": "FLOAT64" }, .... "Edge properties per edge label": { "hasThreat": [ { "property name": "company_code", "property type": "STRING" }, 

by shorting the to only "name" and "property", which looks like:

"Node properties per node label": { "FiscalPeriodKeyFigures": [ { "name": "diluted_epsexcluding_extrordinary_items", "type": "FLOAT64" }, .... "Edge properties per edge label": { "hasThreat": [ { "name": "company_code", "type": "STRING" }, 

We observe 16% reduction of the schema size and no impact on the performance of our system tested with 100 user prompts. This reduces the amount of tokens used in the generation, verification and fix prompts.

Metadata

Metadata

Labels

api: spannerIssues related to the googleapis/langchain-google-spanner-python API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions