Checked other resources
Related Issues / PRs
#4343 and #4345 fixed the same fields/text_fields mismatch for PostgresStore. The SQLite implementation appears to still use text_fields.
Reproduction Steps / Example Code (Python)
from langchain_core.embeddings import Embeddings
from langgraph.store.sqlite import SqliteStore
class RecordingEmbeddings(Embeddings):
def __init__(self):
self.calls = []
def embed_documents(self, texts):
self.calls.append(list(texts))
return [[1.0, 0.0] for _ in texts]
def embed_query(self, text):
return [1.0, 0.0]
embeddings = RecordingEmbeddings()
with SqliteStore.from_conn_string(
":memory:",
index={"dims": 2, "embed": embeddings, "fields": ["text"]},
) as store:
store.setup()
store.put(
("docs",),
"doc",
{"text": "indexed", "metadata": "not indexed"},
)
print("embed_inputs:", embeddings.calls)
print(
"vector_fields:",
[
row[0]
for row in store.conn.execute(
"SELECT field_name FROM store_vectors"
)
],
)
Error Message and Stack Trace (if applicable)
Actual output:
embed_inputs: [['{"metadata": "not indexed", "text": "indexed"}']]
vector_fields: ['$']
Expected output:
embed_inputs: [['indexed']]
vector_fields: ['text']
Description
When fields is set in the index configuration for SqliteStore, it is ignored and the configuration falls back to ['$']. As a result, the entire item is embedded instead of only the configured fields. This can affect search results and send additional item data to an external embedding provider.
The SQLite index configuration normalizer reads text_fields instead of the documented fields key. Using the undocumented text_fields key produces the expected result.
System Info
System Information
OS: Linux
OS Version: 22.04.1-Ubuntu
Python Version: 3.14.7
Package Information
langchain_core: 1.5.2
langsmith: 0.8.18
langchain_protocol: 0.0.18
Checked other resources
Related Issues / PRs
#4343 and #4345 fixed the same
fields/text_fieldsmismatch forPostgresStore. The SQLite implementation appears to still usetext_fields.Reproduction Steps / Example Code (Python)
Error Message and Stack Trace (if applicable)
Description
When
fieldsis set in the index configuration forSqliteStore, it is ignored and the configuration falls back to['$']. As a result, the entire item is embedded instead of only the configured fields. This can affect search results and send additional item data to an external embedding provider.The SQLite index configuration normalizer reads
text_fieldsinstead of the documentedfieldskey. Using the undocumentedtext_fieldskey produces the expected result.System Info
System Information
Package Information