Skip to Content
Solution PlaysPlay 56: Play 56 β€” Semantic Code Search

Play 56 β€” Semantic Code Search

Vector-based code search engine — AST-aware function parsing (tree-sitter), multi-field embedding (signature + docstring + body), hybrid keyword+vector search with boost weights, semantic reranking, incremental re-indexing on git push, natural language→code queries, cross-repo search with access control.

Architecture

Full architecture details: architecture.md

AspectPlay 26 (Semantic Search)Play 56 (Code Search)Play 01 (Enterprise RAG)
ContentGeneral documentsSource code specificallyCorporate knowledge
ParsingText chunkingAST-aware function extractionSemantic chunking
EmbeddingDocument vectorsSignature + docstring + body vectorsDocument vectors
QueryNL β†’ documentNL β†’ code snippetNL β†’ knowledge
FreshnessBatch re-indexGit push webhook (<60s)Scheduled re-index
AccessUser authRepo-level permissionsDoc-level ACL

Key Metrics

MetricTargetDescription
NDCG@5> 0.75Normalized Discounted Cumulative Gain
Recall@10> 85%Relevant results in top 10
P95 Latency< 300msSearch response time
Index Freshness< 60sPush to searchable
Access Control100%No unauthorized repo access

Cost Estimate

ServiceDevProdEnterprise
Azure OpenAI$40$300$1,200
Azure AI Search$0$250$1,000
Azure Blob Storage$3$20$80
Container Apps$8$60$250
Key Vault$1$3$10
Application Insights$0$20$60
Total$52$653$2,600

Detailed breakdown with SKUs and optimization tips: cost.json Β· Azure Pricing CalculatorΒ 

WAF Alignment

PillarImplementation
SecurityRepo-level access control, permission caching, Key Vault
Performance EfficiencyHNSW vector index, hybrid search, semantic reranking
Cost OptimizationIncremental indexing (changed files only), embedding model choice
ReliabilityWebhook retry on failure, weekly full reindex backup
Operational ExcellenceNDCG tracking, latency monitoring, index health dashboard
Responsible AIAccess control prevents code leakage, no PII in code index

FAI Manifest

FieldValue
Play56-semantic-code-search
Version1.0.0
KnowledgeR2-RAG-Architecture, F1-GenAI-Foundations, O3-MCP-Tools-Functions
WAF Pillarssecurity, performance-efficiency, reliability, operational-excellence
Groundednessβ‰₯ 85%
Safety0 violations max
Last updated on