Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches: [main, phase*]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-macos:
name: Build & Test (macOS)
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Select Xcode 16
run: sudo xcode-select -s /Applications/Xcode_16.app

- name: Build
run: swift build -v

- name: Run Tests
run: swift test -v --filter "!IntegrationTests"

build-linux:
name: Build & Test (Linux)
runs-on: ubuntu-latest
container: swift:6.0
steps:
- uses: actions/checkout@v4

- name: Build
run: swift build -v

- name: Run Tests
run: swift test -v --filter "!IntegrationTests"

integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: [build-macos, build-linux]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: zoni_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

container: swift:6.0

steps:
- uses: actions/checkout@v4

- name: Run Integration Tests
env:
PG_CONNECTION_STRING: postgres://postgres:postgres@postgres:5432/zoni_test
run: swift test -v --filter "IntegrationTests"

build-ios:
name: Build (iOS)
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Select Xcode 16
run: sudo xcode-select -s /Applications/Xcode_16.app

- name: Build for iOS Simulator
run: |
xcodebuild build \
-scheme Zoni \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \
-skipMacroValidation
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate Release Notes
id: notes
run: |
# Extract version from tag
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT

# Extract changelog section for this version
sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | head -n -1 > release_notes.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: release_notes.md
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126 changes: 126 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Changelog

All notable changes to Zoni will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2025-01-05

### Added

#### Core Framework (Phase 1)
- Core types: `Document`, `Chunk`, `Embedding`, `Metadata`, `RetrievalResult`
- Protocol definitions: `VectorStore`, `EmbeddingProvider`, `ChunkingStrategy`, `DocumentLoader`, `LLMProvider`, `Retriever`
- Comprehensive error handling with `ZoniError`
- `RAGConfiguration` for pipeline customization

#### Document Processing (Phase 2)
- Document loaders: `TextLoader`, `MarkdownLoader`, `HTMLLoader`, `JSONLoader`, `CSVLoader`, `PDFLoader`, `WebLoader`
- `LoaderRegistry` for automatic loader selection by file extension
- `DirectoryLoader` for batch file processing
- Chunking strategies: `FixedSizeChunker`, `SentenceChunker`, `ParagraphChunker`, `RecursiveChunker`, `SemanticChunker`, `MarkdownChunker`, `CodeChunker`
- `TokenCounter` with multiple tokenizer support

#### Embeddings (Phase 2)
- Embedding providers: `OpenAIEmbedding`, `CohereEmbedding`, `VoyageEmbedding`, `OllamaEmbedding`
- `BatchEmbedder` for efficient batch processing
- `EmbeddingCache` with LRU eviction and TTL
- `RateLimiter` for API rate limiting

#### Vector Storage (Phase 3)
- Vector stores: `InMemoryVectorStore`, `SQLiteVectorStore`, `QdrantStore`, `PineconeStore`
- `VectorStoreFactory` for configuration-driven instantiation
- SIMD-optimized vector math (cosine similarity, euclidean distance)
- Comprehensive metadata filtering

#### Retrieval (Phase 4A)
- Retrieval strategies: `VectorRetriever`, `KeywordRetriever`, `HybridRetriever`, `MultiQueryRetriever`, `MMRRetriever`, `RerankerRetriever`
- Reranking support with `Reranker` protocol

#### Query Engine (Phase 4B)
- `QueryEngine` orchestrating retrieval and generation
- Response synthesizers: `CompactSynthesizer`, `RefineSynthesizer`, `TreeSummarizeSynthesizer`
- `ContextBuilder` for context assembly
- Streaming query support with `RAGStreamEvent`

#### Server Integration (Phase 5)
- **ZoniServer**: Multi-tenancy, job queue system, server DTOs
- **ZoniVapor**: Vapor framework integration with controllers and middleware
- **ZoniHummingbird**: Hummingbird framework integration with routes
- `PgVectorStore` for PostgreSQL with pgvector
- WebSocket support for real-time streaming

#### Apple Platform Extensions (Phase 5)
- **ZoniApple**: On-device ML extensions
- `NLEmbeddingProvider` using NaturalLanguage framework
- `MLXEmbeddingProvider` for Apple Silicon GPU acceleration
- `SwiftEmbeddingsProvider` integration
- `FoundationModelsProvider` for iOS 26+ Foundation Models
- Memory optimization strategies

#### Agent Integration (Phase 5)
- **ZoniAgents**: SwiftAgents framework bridge
- RAG tools: `SearchTool`, `IngestTool`, `QueryTool`, `SummarizeTool`, `MultiIndexTool`
- Adapter implementations for seamless agent integration

#### Pipeline & Polish (Phase 6)
- `RAGPipeline` orchestrator with full ingestion and query support
- `LoaderRegistry` for automatic document loader selection
- Progress tracking with `IngestionProgress` and `QueryProgress`
- Factory methods: `.inMemory()`, `.postgres()`, `.apple()`, `.mlx()`
- Comprehensive documentation and examples
- CI/CD with GitHub Actions

### Changed
- N/A (initial release)

### Deprecated
- N/A (initial release)

### Removed
- N/A (initial release)

### Fixed
- N/A (initial release)

### Security
- All types are `Sendable` for Swift 6 concurrency safety
- Actor-based isolation for thread-safe operations
- No force unwraps in production code

## [0.5.0] - 2025-01-04 (Phase 5 - Internal)

### Added
- Server framework integrations (Vapor, Hummingbird)
- Apple platform extensions
- Multi-tenancy support
- Job queue system

## [0.4.0] - 2025-01-03 (Phase 4 - Internal)

### Added
- Query engine with streaming
- Multiple retrieval strategies
- Response synthesizers

## [0.3.0] - 2025-01-02 (Phase 3 - Internal)

### Added
- Vector store backends
- Metadata filtering
- SIMD optimizations

## [0.2.0] - 2025-01-01 (Phase 2 - Internal)

### Added
- Document loaders
- Chunking strategies
- Embedding providers

## [0.1.0] - 2024-12-30 (Phase 1 - Internal)

### Added
- Initial core types and protocols
- Error handling framework
- Configuration system
Loading
Loading