-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
14 lines (12 loc) · 691 Bytes
/
init.sql
File metadata and controls
14 lines (12 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Create the documents table
CREATE TABLE IF NOT EXISTS documents (
id SERIAL PRIMARY KEY,
content_type VARCHAR(50) NOT NULL, -- 'text' or 'image'
text_content TEXT, -- The chunked text (if type is text)
image_path TEXT, -- The local path to the extracted image (if type is image)
embedding VECTOR(3072), -- The vector representation from text-embedding-004 (or multimodalembedding)
source_filename TEXT -- The name of the PDF this came from
);
-- Optional: Create an HNSW index to speed up vector searches (useful for larger datasets)