Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

PDF Embedding (v1)

GitHub

This example builds an embedding index from local PDF files. It converts PDFs to markdown, chunks the text, embeds each chunk, and stores the results in Postgres (pgvector). It also provides a simple query demo.

We appreciate a star ⭐ at CocoIndex Github if this is helpful.

Prerequisite

Install Postgres if you don't have one.

Run

Install dependencies:

pip install -e .

Set a database URL (or use .env):

export POSTGRES_URL="postgres://cocoindex:cocoindex@localhost/cocoindex"

Build/update the index:

cocoindex update main.py

Query:

python main.py query "what is attention?"

Note: this example does not create a vector index; queries will do a sequential scan.