Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sf-bot/rag-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@sf-bot/rag-core
Core RAG (Retrieval-Augmented Generation) schema with pgvector support for document embeddings.
Overview
This package provides the foundational database schema for storing and managing document embeddings using PostgreSQL and pgvector. It supports:
- Multiple embedding models per collection
- Semantic chunking strategies
- JSON/CSV import and export for migrations
Schema
Tables
| Table | Description |
|---|---|
rag.embedding_model |
Embedding model configurations (OpenAI, Cohere, local, etc.) |
rag.collection |
Document collections with chunking configuration |
rag.collection_model |
Links collections to embedding models (many-to-many) |
rag.document |
Source documents with content and metadata |
rag.chunk |
Document segments/chunks for embedding |
rag.embedding |
Vector embeddings (pgvector) linked to chunks |
Chunking Configuration
The chunk_config JSONB column on rag.collection supports:
{
"strategy": "semantic",
"max_tokens": 512,
"overlap_tokens": 50
}Supported strategies: semantic, fixed, sentence, paragraph
Installation
pgpm deploy @sf-bot/rag-coreRequirements
- PostgreSQL 17+
- pgvector extension