Initial commit: Pegas Memory (PG + Qdrant + Memgraph, MCP server, 14 tools)
This commit is contained in:
commit
83e77ea8c9
24 files changed
+2201
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""Инициализация: применить schema.sql + создать коллекцию Qdrant."""
|
||||
import sys, pathlib
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from pegas_memory import config, db, qdrant_store
|
||||
|
||||
def main():
|
||||
print("Применяю schema.sql к", config.PG_DSN.split('@')[-1])
|
||||
sql = pathlib.Path(__file__).resolve().parents[1] / "schema.sql"
|
||||
conn = db.connect()
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(sql.read_text())
|
||||
conn.commit()
|
||||
print(" -> schema OK")
|
||||
|
||||
print("Создаю коллекцию Qdrant", config.QDRANT_COLLECTION, "(dim=%d)" % config.EMBED_DIM)
|
||||
qdrant_store.ensure_collection()
|
||||
print(" -> collection OK")
|
||||
|
||||
# проверить эмбеддинг
|
||||
v = __import__('pegas_memory.embedding', fromlist=['embed']).embed("проверка")
|
||||
print(" -> embedding dim:", len(v))
|
||||
print("DONE")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user