Skip to content

Commit c6a2f20

Browse files
committed
feat(store): add vector store implementation with LanceDB integration
- Implemented VectorStoreTable class for managing vector storage operations - Added StoreDocument and SearchedDocument data structures for document handling - Integrated LanceDB for vector database operations with proper schema management - Implemented add_documents method for batch document insertion with UUID generation - Added search_document method for similarity search using vector embeddings - Created helper methods for record batch processing and column extraction - Added metadata handling with JSON serialization support - Implemented error handling for missing columns and type validation - Updated package version from 0.2.3 to 0.2.4
1 parent 19a2535 commit c6a2f20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/fabricatio-rag/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "fabricatio-rag"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
description = "A Python library for Retrieval-Augmented Generation (RAG) capabilities in LLM applications."
55
readme = "README.md"
66
license = { file = "LICENSE" }

packages/fabricatio-rag/src/store.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use arrow_array::array::*;
66
use arrow_array::cast::AsArray;
77
use arrow_array::types::*;
88

9-
use arrow_array::{RecordBatch, RecordBatchIterator};
9+
use arrow_array::RecordBatch;
1010
use error_mapping::AsPyErr;
1111
use futures_util::TryStreamExt;
1212
use lancedb::Table;
@@ -49,7 +49,7 @@ type DataContainers = (
4949
Vec<Option<JsonString>>,
5050
);
5151

52-
#[gen_stub_pyclass]
52+
#[cfg_attr(feature = "stubgen", gen_stub_pyclass)]
5353
#[pyclass(set_all, get_all, from_py_object)]
5454
#[derive(Clone, Debug)]
5555
pub struct StoreDocument {
@@ -63,7 +63,7 @@ pub struct StoreDocument {
6363
/// This structure contains the core information of a searched document including
6464
/// its unique identifier, content, timestamp of creation/modification, and any
6565
/// associated metadata stored as JSON string.
66-
#[gen_stub_pyclass]
66+
#[cfg_attr(feature = "stubgen", gen_stub_pyclass)]
6767
#[pyclass(get_all, skip_from_py_object)]
6868
#[derive(Clone, Debug)]
6969
pub struct SearchedDocument {

0 commit comments

Comments
 (0)