chore: add .gitignore and init.sql, update Makefile and docs
This commit is contained in:
parent
dec52a19e6
commit
fe374cfd03
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
server/server/
|
||||
16
Makefile
16
Makefile
@ -73,22 +73,8 @@ endif
|
||||
# -----------------------------------------------------------------------------
|
||||
# Database initialization
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
init-db:
|
||||
psql $(PG_DSN) <<'SQL'
|
||||
CREATE EXTENSION IF NOT EXISTS vector;
|
||||
CREATE TABLE IF NOT EXISTS documents (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
repo TEXT NOT NULL,
|
||||
path TEXT NOT NULL,
|
||||
chunk_id INT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
embedding VECTOR(1536),
|
||||
metadata JSONB
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS documents_embedding_idx ON documents USING hnsw (embedding vector_cosine_ops);
|
||||
CREATE INDEX IF NOT EXISTS idx_documents_metadata ON documents USING gin (metadata);
|
||||
SQL
|
||||
@psql $(PG_DSN) -f docs/init.sql
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build targets
|
||||
|
||||
18
docs/init.sql
Normal file
18
docs/init.sql
Normal file
@ -0,0 +1,18 @@
|
||||
-- init.sql
|
||||
CREATE EXTENSION IF NOT EXISTS vector;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS documents (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
repo TEXT NOT NULL,
|
||||
path TEXT NOT NULL,
|
||||
chunk_id INT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
embedding VECTOR(1536),
|
||||
metadata JSONB
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS documents_embedding_idx
|
||||
ON documents USING hnsw (embedding vector_cosine_ops);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_documents_metadata
|
||||
ON documents USING gin (metadata);
|
||||
@ -79,3 +79,8 @@ xcontrol/
|
||||
流量统计 ✅ 基于 Xray stats ✅ 支持 stats + DeepFlow 双通道
|
||||
WebUI + 后端整合 ✅ 前后端集成 ✅ Go embed Vue,可做 SaaS 化
|
||||
可观测性 + 控制分离 ❌ 不支持 ✅ 支持 Agent 拉取或观察方式
|
||||
|
||||
## Init DB
|
||||
|
||||
export PG_DSN="postgres://shenlan@127.0.0.1:5432/postgres"
|
||||
make init-db
|
||||
|
||||
8
ui/dist/index.html
vendored
8
ui/dist/index.html
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user