Conversation
## New Features ### ParentChildChunker - Hierarchical chunking strategy for 4K context windows - Creates large parent chunks (2000 chars) with small children (400 chars) - Maintains bidirectional parent-child relationships in metadata - Configurable overlap, separators, and output options ### ParentChildRetriever - Searches child embeddings but returns parent chunks for context - Score aggregation strategies: max, average, sum - Includes ParentLookup protocol and VectorStoreParentLookup actor - LRU caching for efficient parent lookups ### HuggingFaceEmbedding - HuggingFace Inference API integration - Supports MiniLM (384d), BGE (768d/1024d), E5 (1024d), Jina (768d) - Configurable wait_for_model for cold starts - Rate limit handling with retry-after support ### MistralEmbedding - Mistral AI embedding API (mistral-embed, 1024d) - Index-sorted response handling for order consistency - Rate limiter factory method added ## Tests - Comprehensive ParentChildChunkerTests covering: - Basic chunking, relationship integrity, overlap validation - Metadata completeness, edge cases, configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
P1 Features (Document Preprocessing): - VisionOCRProcessor: Actor-based OCR using Apple Vision framework - extractText(from: URL/CGImage) for images - extractTextFromPDF(at:) for multi-page PDFs - Configurable languages and recognition levels - TableExtractor: Extracts tables from document images - ExtractedTable struct with markdown and CSV output - Uses VNDetectRectanglesRequest + VNRecognizeTextRequest - Groups text by Y-coordinate into rows P2 Features (Advanced Retrieval & Evaluation): - ChunkGraph: Graph data structure for chunk relationships - EdgeType: sequential, semantic, reference - Builds bidirectional edges for adjacent chunks - Creates semantic edges for high-similarity chunks (threshold: 0.8) - GraphRetriever: BFS-based graph traversal retrieval - Combines vector search with graph expansion - Configurable hops (default: 2) and edge threshold (0.7) - Score propagation with decay factor - RAGEvaluator: Evaluation framework for RAG pipelines - RetrievalMetrics: precision, recall, F1, MRR, NDCG - GenerationMetrics: faithfulness, relevance, coherence - Optional LLM judge for faithfulness scoring All implementations use Swift 6.0 actor-based concurrency with Sendable conformance. Build verified with zero errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review Fixes (6 warnings resolved):
1. Task Cancellation in ParentChildRetriever
- Added Task.checkCancellation() before embedding, after embedding,
and during parent fetching loop
- Prevents wasted resources when caller cancels mid-operation
2. O(n²) Complexity Limit in ChunkGraph
- Added 100,000 comparison limit to buildSemanticEdges()
- Documented O(n²) complexity in method documentation
- Debug logging when limit is hit, suggesting k-NN alternatives
3. BFS Cancellation in GraphRetriever
- Added Task.checkCancellation() at start of each BFS hop
- Prevents long graph traversals from blocking cancellation
4. Error Logging in ParentChildRetriever
- Added DEBUG-only logging when parent fetch fails
- Improves production debugging without performance impact
5. Overflow Protection in ParentChildChunker
- Used addingReportingOverflow() for offset calculation
- Prevents integer overflow with very large (>2GB) documents
6. Documentation for nonisolated(unsafe) in TableExtractor
- Added SAFETY comment explaining why VNRectangleObservation
is safe to transfer despite missing Sendable conformance
All fixes maintain Swift 6.0 strict concurrency compliance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review Fixes (3 Critical + 4 Warnings): **Critical Issues:** 1. TableExtractor Vision callback - Replaced `nonisolated(unsafe)` with Sendable `DetectedRegion` struct to safely cross actor boundaries 2. SQLiteVectorStore schema init - Added NSLock protection to prevent potential race condition in `createSchemaIfNeeded()` 3. ChunkGraph O(n²) truncation - Added `truncationWarning` property with detailed progress tracking (% processed, chunks affected) **Warnings:** 1. OllamaEmbedding batch - Added Task.checkCancellation() between iterations 2. ParentChildChunker overflow - Now throws ZoniError.chunkingFailed instead of using Int.max fallback 3. RAGEvaluator regex - Added proper error handling and DEBUG logging for regex failures 4. SQLiteVectorStore dimensions - Fixed validation to use actualDimensions when available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The truncationWarning property was private(set), preventing callers from checking if semantic edge building was truncated. Changed to public private(set) with usage example in documentation. This ensures callers can detect and respond to partial graph construction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements Phase 1 of GPU optimization plan with 10-432x speedups on large datasets (>10k vectors). Adds adaptive CPU/GPU backend selection, 6 Metal compute kernels (cosine similarity, pairwise matrix, MMR scoring), comprehensive test coverage, and automatic fallback for filtered searches. Fixes lambda validation and candidateMultiplier bounds in MMR retriever for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@claude do a comprehensive code review |
|
Claude encountered an error —— View job Comprehensive Code Review
|
- Added GPUVectorStore for Metal-accelerated retrieval in ZoniApple - Refactored SemanticChunker to use injectable SimilarityCalculator - Implemented MetalSimilarityCalculator for 7x chunking speedup - Added SemanticChunkerBenchmarks - Finalized cleanup of ZoniServer integrations (removed legacy ZoniVapor/ZoniHummingbird folders)
Both server framework integrations were behind #if compilation flags that were never activated — no SPM dependencies declared, no tests running, and no feature parity between them. Removes 20 integration files (~2.8k LOC), 6 stale audit docs, 25 auto-generated CLAUDE.md files, and an empty JobProtocol.swift duplicate. Updates README and doc comments to reflect the removal. Adds ZoniConduit integration layer and various test/source improvements from the performance branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review: Performance (#9)This is a substantial PR adding significant new features to the Zoni RAG framework. The overall code quality is high — excellent Swift 6 actor usage, comprehensive documentation, and solid architectural patterns. Below is a detailed review grouped by category. Summary
Bugs / Correctness IssuesCritical:
|
| Priority | Item |
|---|---|
| Must Fix | Replace precondition with runtime-throwing validation in PgVectorStore |
| Must Fix | Add warning/error for PineconeStore nested metadata loss |
| Must Fix | Add PineconeStore tests before merging |
| Should Fix | Fix GPUVectorStore O(n²) rebuild on bulk insert |
| Should Fix | Fix O(n) LRU operations in VectorStoreParentLookup |
| Should Fix | Add retry logic to PineconeStore add()/delete() |
| Should Fix | Make RAGEvaluator score parsing failures visible in production |
| Should Fix | Remove local machine paths from IMPLEMENTATION_TASK_BREAKDOWN.md |
| Consider | Parallelize OCRProcessor PDF page extraction with TaskGroup |
| Consider | Add baseline assertions to PerformanceTests |
| Consider | Make GraphRetriever decay factor configurable |
| Consider | Document SQLiteVectorStore scaling limits prominently in the README |
Overall this is a well-engineered PR with excellent Swift 6 concurrency patterns and documentation. The precondition/release-build SQL validation issue and missing PineconeStore tests are the two items I'd treat as blockers; the rest are good follow-up candidates.

No description provided.