Skip to content

Commit 6e9c1ce

Browse files
authored
feat: create vector extension (#71)
1 parent d628202 commit 6e9c1ce

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
livekit-plugins-noise-cancellation
22
livekit-agents[openai,silero,turn-detector,deepgram,noise_cancellation]
3-
memobase
3+
memobase
4+
python-dotenv

src/server/api/memobase_server/connectors.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,19 @@
3434
Session = sessionmaker(bind=DB_ENGINE)
3535

3636

37+
def create_pgvector_extension():
38+
try:
39+
with Session() as session:
40+
session.execute(text("CREATE EXTENSION IF NOT EXISTS vector;"))
41+
session.commit()
42+
LOG.info("pgvector extension created or already exists")
43+
except Exception as e:
44+
LOG.error(f"Failed to create pgvector extension: {e}")
45+
46+
3747
def create_tables():
48+
create_pgvector_extension()
49+
3850
REG.metadata.create_all(DB_ENGINE)
3951
with Session() as session:
4052
Project.initialize_root_project(session)

0 commit comments

Comments
 (0)