feat(client): typed relationship extraction + model-aware semantic cache#20
Merged
Conversation
ExtractRelationships (client/extract.go): typed subject-predicate-object triple extractor over ChatWithStructuredOutput, modeled on cocoindex's ExtractByLlm(output_type=list[Relationship]). Noun-constrained entities with an optional predicate allowlist; knowledge-graph consumers can call it instead of hand-rolling extraction prompts and JSON parsing. Semantic embedding cache (client/embedding_cache.go): tag each cache entry with the embedding model that produced its vector and skip cross-model entries in lookup() before computing cosine similarity. Previously a model swap could serve a response cached under a different (incomparable) embedding space. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The tok v0.1.0 tag was moved to its current main HEAD, changing the module hash. Refresh the recorded go.sum hashes so module verification and the CI tidy check pass. No code change; tok's public API is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The tok v0.1.0 tag was moved; the public module proxy can cache the old zip for that immutable version, causing checksum mismatches against the refreshed go.sum. Fetching GrayCodeAI modules directly from VCS keeps CI consistent with the committed hashes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GOPROXY=direct forced the entire module graph (incl. golangci-lint and its deps) off the public proxy, breaking 'go install golangci-lint'. GOPRIVATE already fetches GrayCodeAI modules directly from VCS, and the public proxy has since refreshed tok@v0.1.0 to the moved-tag content, so both paths now yield the go.sum hash. Reverting the over-broad proxy override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eyrie resolves tok via 'go.work replace => ../tok' (CI clones tok locally), so the tok@v0.1.0 hash in go.sum is not exercised — the original hash was correct and hygiene passed with it. The earlier hand-edit to the moved-tag hash made 'go mod tidy' report go.sum out of date. Restoring the original. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0c80e3c to
9feb00f
Compare
Patel230
added a commit
that referenced
this pull request
Jun 8, 2026
…che (#20) * feat(client): typed relationship extraction + model-aware semantic cache ExtractRelationships (client/extract.go): typed subject-predicate-object triple extractor over ChatWithStructuredOutput, modeled on cocoindex's ExtractByLlm(output_type=list[Relationship]). Noun-constrained entities with an optional predicate allowlist; knowledge-graph consumers can call it instead of hand-rolling extraction prompts and JSON parsing. Semantic embedding cache (client/embedding_cache.go): tag each cache entry with the embedding model that produced its vector and skip cross-model entries in lookup() before computing cosine similarity. Previously a model swap could serve a response cached under a different (incomparable) embedding space. * fix(deps): update tok@v0.1.0 checksum in go.sum The tok v0.1.0 tag was moved to its current main HEAD, changing the module hash. Refresh the recorded go.sum hashes so module verification and the CI tidy check pass. No code change; tok's public API is unchanged. * ci: set GOPROXY=direct to bypass stale-proxy go.sum mismatch The tok v0.1.0 tag was moved; the public module proxy can cache the old zip for that immutable version, causing checksum mismatches against the refreshed go.sum. Fetching GrayCodeAI modules directly from VCS keeps CI consistent with the committed hashes. * ci: drop GOPROXY=direct; GOPRIVATE already routes GrayCodeAI direct GOPROXY=direct forced the entire module graph (incl. golangci-lint and its deps) off the public proxy, breaking 'go install golangci-lint'. GOPRIVATE already fetches GrayCodeAI modules directly from VCS, and the public proxy has since refreshed tok@v0.1.0 to the moved-tag content, so both paths now yield the go.sum hash. Reverting the over-broad proxy override. * Revert unnecessary go.sum tok hash edit eyrie resolves tok via 'go.work replace => ../tok' (CI clones tok locally), so the tok@v0.1.0 hash in go.sum is not exercised — the original hash was correct and hygiene passed with it. The earlier hand-edit to the moved-tag hash made 'go mod tidy' report go.sum out of date. Restoring the original. ---------
Patel230
added a commit
that referenced
this pull request
Jun 8, 2026
…che (#20) * feat(client): typed relationship extraction + model-aware semantic cache ExtractRelationships (client/extract.go): typed subject-predicate-object triple extractor over ChatWithStructuredOutput, modeled on cocoindex's ExtractByLlm(output_type=list[Relationship]). Noun-constrained entities with an optional predicate allowlist; knowledge-graph consumers can call it instead of hand-rolling extraction prompts and JSON parsing. Semantic embedding cache (client/embedding_cache.go): tag each cache entry with the embedding model that produced its vector and skip cross-model entries in lookup() before computing cosine similarity. Previously a model swap could serve a response cached under a different (incomparable) embedding space. * fix(deps): update tok@v0.1.0 checksum in go.sum The tok v0.1.0 tag was moved to its current main HEAD, changing the module hash. Refresh the recorded go.sum hashes so module verification and the CI tidy check pass. No code change; tok's public API is unchanged. * ci: set GOPROXY=direct to bypass stale-proxy go.sum mismatch The tok v0.1.0 tag was moved; the public module proxy can cache the old zip for that immutable version, causing checksum mismatches against the refreshed go.sum. Fetching GrayCodeAI modules directly from VCS keeps CI consistent with the committed hashes. * ci: drop GOPROXY=direct; GOPRIVATE already routes GrayCodeAI direct GOPROXY=direct forced the entire module graph (incl. golangci-lint and its deps) off the public proxy, breaking 'go install golangci-lint'. GOPRIVATE already fetches GrayCodeAI modules directly from VCS, and the public proxy has since refreshed tok@v0.1.0 to the moved-tag content, so both paths now yield the go.sum hash. Reverting the over-broad proxy override. * Revert unnecessary go.sum tok hash edit eyrie resolves tok via 'go.work replace => ../tok' (CI clones tok locally), so the tok@v0.1.0 hash in go.sum is not exercised — the original hash was correct and hygiene passed with it. The earlier hand-edit to the moved-tag hash made 'go mod tidy' report go.sum out of date. Restoring the original. ---------
Patel230
added a commit
that referenced
this pull request
Jun 8, 2026
…che (#20) * feat(client): typed relationship extraction + model-aware semantic cache ExtractRelationships (client/extract.go): typed subject-predicate-object triple extractor over ChatWithStructuredOutput, modeled on cocoindex's ExtractByLlm(output_type=list[Relationship]). Noun-constrained entities with an optional predicate allowlist; knowledge-graph consumers can call it instead of hand-rolling extraction prompts and JSON parsing. Semantic embedding cache (client/embedding_cache.go): tag each cache entry with the embedding model that produced its vector and skip cross-model entries in lookup() before computing cosine similarity. Previously a model swap could serve a response cached under a different (incomparable) embedding space. * fix(deps): update tok@v0.1.0 checksum in go.sum The tok v0.1.0 tag was moved to its current main HEAD, changing the module hash. Refresh the recorded go.sum hashes so module verification and the CI tidy check pass. No code change; tok's public API is unchanged. * ci: set GOPROXY=direct to bypass stale-proxy go.sum mismatch The tok v0.1.0 tag was moved; the public module proxy can cache the old zip for that immutable version, causing checksum mismatches against the refreshed go.sum. Fetching GrayCodeAI modules directly from VCS keeps CI consistent with the committed hashes. * ci: drop GOPROXY=direct; GOPRIVATE already routes GrayCodeAI direct GOPROXY=direct forced the entire module graph (incl. golangci-lint and its deps) off the public proxy, breaking 'go install golangci-lint'. GOPRIVATE already fetches GrayCodeAI modules directly from VCS, and the public proxy has since refreshed tok@v0.1.0 to the moved-tag content, so both paths now yield the go.sum hash. Reverting the over-broad proxy override. * Revert unnecessary go.sum tok hash edit eyrie resolves tok via 'go.work replace => ../tok' (CI clones tok locally), so the tok@v0.1.0 hash in go.sum is not exercised — the original hash was correct and hygiene passed with it. The earlier hand-edit to the moved-tag hash made 'go mod tidy' report go.sum out of date. Restoring the original. ---------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ExtractRelationships(client/extract.go, new): typed S-P-O triple extractor overChatWithStructuredOutput, modeled on cocoindexExtractByLlm(output_type=list[Relationship]). Noun-constrained entities + optional predicate allowlist.client/embedding_cache.go): tag entries with their embedding model and skip cross-model entries before cosine — a model swap can no longer serve a response from an incomparable embedding space.Tests
extract_test.go+TestEmbeddingCache_ModelIsolation; full client suite passes; gofumpt v0.7.0 clean.🤖 Generated with Claude Code