You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5d73a45
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: replace PGlite with file-based vector store for RAG
- Created file-based vector store using Float32Array + JSON + markdown files
- Stores vectors in binary format (vectors.bin) and metadata in index.json
- Documents saved as markdown files in documents/ directory
- Works globally from any folder (~/.opencode/knowledge/)
- Works in Bun compiled binaries (no bunfs filesystem issues)
- In-memory cosine similarity search with configurable thresholds
- Removed PGlite, pg, and pgvector dependencies
- Simplified storage: one embedding per document (no chunking)
- Storage path: ~/.opencode/knowledge/
- documents/*.md (human-readable content)
- vectors.bin (Float32Array binary)
- index.json (metadata + offsets)
Fixesanomalyco#414, anomalyco#15032 (PGlite Bun compile incompatibility)
message: "RAG Knowledge Base initialized successfully!",
176
-
dbPath,
159
+
message: `RAG Knowledge Base initialized successfully!\n\nLocation: ${knowledgePath}\n\nYou can now use Perplexity search and other tools to populate your knowledge base.`,
160
+
knowledgePath,
177
161
}
178
162
}catch(error){
179
-
s.stop("Database initialization failed")
163
+
s.stop("Vector store initialization failed")
180
164
return{
181
165
success: false,
182
-
message: `Failed to initialize database: ${errorinstanceofError ? error.message : String(error)}`,
0 commit comments