|
| 1 | +# What's New in tinystruct 1.7.25 |
| 2 | + |
| 3 | +This document highlights the new features, improvements, and changes introduced in tinystruct version 1.7.25. |
| 4 | + |
| 5 | +> See also: [What's New in 1.7.23](whats-new-1.7.23.md) for earlier features including the built-in POJO generator and native LocalDateTime support. |
| 6 | +
|
| 7 | +## Major New Features |
| 8 | + |
| 9 | +### 1. Vector Database Support |
| 10 | + |
| 11 | +Version 1.7.25 introduces comprehensive support for vector operations, enabling next-gen AI applications that require similarity searches and embedding storage. |
| 12 | + |
| 13 | +**Key Components:** |
| 14 | +- **`org.tinystruct.data.Vector`**: A new interface for managing vector collections. |
| 15 | +- **`org.tinystruct.data.VectorOperator`**: A specialized operator for executing vector-based queries, supporting SQLite as the default storage engine. |
| 16 | +- **Similarity Search**: Built-in support for cosine similarity searches to find related data based on embedding vectors. |
| 17 | + |
| 18 | +**Example Usage:** |
| 19 | + |
| 20 | +```java |
| 21 | +// Adding a vector to the database |
| 22 | +double[] embedding = getEmbedding("Some text content"); |
| 23 | +try (VectorOperator operator = new VectorOperator()) { |
| 24 | + operator.add(embedding, "label", 123, "entityType"); |
| 25 | +} |
| 26 | + |
| 27 | +// Searching for similar vectors |
| 28 | +try (VectorOperator operator = new VectorOperator()) { |
| 29 | + List<SearchResult> results = operator.search(queryVector, 5); |
| 30 | + for (SearchResult result : results) { |
| 31 | + System.out.println("Similar entity ID: " + result.getEntityId()); |
| 32 | + } |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +### 2. Performance & Stability Improvements |
| 37 | + |
| 38 | +- **`SSEPushManager` Fixes**: Enhanced reliability for Server-Sent Events with better connection management and test coverage. |
| 39 | +- **NullPointerException Handling**: Fixed various edge cases where NPEs could occur during complex request handling. |
| 40 | +- **Optimized Thread Management**: Replaced active-wait loops with more efficient thread blocking mechanisms, reducing CPU usage during idle periods. |
| 41 | +- **Enhanced Application Management**: Improved stability in the `ApplicationManager` for starting and stopping services. |
| 42 | + |
| 43 | +## Configuration |
| 44 | + |
| 45 | +To use the vector database, you can configure the following properties: |
| 46 | + |
| 47 | +```properties |
| 48 | +# config.properties |
| 49 | +vector.database.driver=org.sqlite.JDBC |
| 50 | +vector.database.url=jdbc:sqlite:src/main/resources/vector.db |
| 51 | +``` |
| 52 | + |
| 53 | +## Migration Guide |
| 54 | + |
| 55 | +### From 1.7.23 to 1.7.25 |
| 56 | + |
| 57 | +1. **Update Maven Dependency** |
| 58 | + ```xml |
| 59 | + <dependency> |
| 60 | + <groupId>org.tinystruct</groupId> |
| 61 | + <artifactId>tinystruct</artifactId> |
| 62 | + <version>1.7.25</version> |
| 63 | + </dependency> |
| 64 | + ``` |
| 65 | + |
| 66 | +2. **Initialize Vector Database** (Optional) |
| 67 | + If you plan to use vector features, ensure the `vector.db` file is present in your resources or configured correctly in your properties. |
| 68 | + |
| 69 | +## Community and Resources |
| 70 | + |
| 71 | +- **GitHub**: <https://github.com/tinystruct/tinystruct> |
| 72 | +- **Documentation**: <https://tinystruct.org> |
| 73 | +- **Examples**: <https://github.com/tinystruct/tinystruct-examples> |
| 74 | + |
| 75 | +## Conclusion |
| 76 | + |
| 77 | +Version 1.7.25 focuses on bringing AI-native capabilities to the tinystruct framework through its new vector support, while continuing to improve the core performance and stability that developers expect. |
0 commit comments