Problem
Symbol embeddings currently use only the symbol's own name and source text. For nested symbols like methods within classes, this loses valuable hierarchical context.
Example: A process() method inside PaymentHandler class is embedded without any reference to its parent class. When a user searches for "payment processing" or "PaymentHandler", this method may not rank well because the parent class context isn't captured in the embedding.
Proposed Solution
Include parent symbol context in embeddings for nested symbols so that:
- Methods are associated with their containing class
- Nested classes include outer class context
- Searches for class names can find methods within them
Benefits
- Better semantic matching for class methods
- Aligns with how developers think about code (qualified names)
- Improves "find methods of X class" queries
Considerations
- Slightly longer embedding inputs
- Marginal indexing latency increase
- Would require re-indexing existing codebases
Acceptance Criteria
Problem
Symbol embeddings currently use only the symbol's own name and source text. For nested symbols like methods within classes, this loses valuable hierarchical context.
Example: A
process()method insidePaymentHandlerclass is embedded without any reference to its parent class. When a user searches for "payment processing" or "PaymentHandler", this method may not rank well because the parent class context isn't captured in the embedding.Proposed Solution
Include parent symbol context in embeddings for nested symbols so that:
Benefits
Considerations
Acceptance Criteria