fix(api): remove embedding property access from debug endpoints#23
Merged
Conversation
Remove references to r.chunk.embedding in /retrieve and /debug endpoints. ContentChunk does not have an embedding property - embeddings are stored in the vector DB and not returned on retrieval queries. Replace embeddingPrefix with score in /debug for more useful diagnostics. Fixes TypeScript build error blocking Railway deployments since PR #17. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
r.chunk.embeddingin/retrieveand/debugendpoints that were causing TypeScript build errors (TS2339)ContentChunktype does not include anembeddingproperty — embeddings are stored in the vector DB and not returned on retrieval queriesembeddingPrefixwithscorein/debugendpoint for more useful diagnosticsRoot cause: PR #17 (debug endpoints) accessed
r.chunk.embeddingbutRetrievalResult.chunkis typed asContentChunk, which does not have anembeddingfield. TheEmbeddedChunktype (which includes embeddings) only exists during the ingestion phase.Impact: This error was blocking ALL Railway deployments since PR #17.
Verification
pnpm buildpasses with zero TypeScript errorsTest plan
/debugendpoint returns valid JSON withscoreinstead ofembeddingPrefix/retrieveendpoint returns chunks withoutembeddingPrefix