Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Code Embedding (v1) 🧑‍💻

This example extracts code chunks from local Python files, stores the code and their vector embeddings in Postgres (pgvector), and provides a simple semantic search demo for code.

Prerequisites

  • A running Postgres with the pgvector extension available
  • POSTGRES_URL set, e.g.
export POSTGRES_URL="postgres://cocoindex:cocoindex@localhost/cocoindex"

Run

Install deps:

pip install -e .

Build/update the index (writes rows into Postgres):

cocoindex update main.py

Query:

python main.py query "embedding"