@sisu-ai/rag-core
v1.0.0
Published
Reusable backend-agnostic RAG mechanics for Sisu.
Readme
@sisu-ai/rag-core
Reusable backend-agnostic RAG mechanics for Sisu.
Exports
- chunkers:
characterChunker,sentenceChunker,paragraphChunker,getChunker - direct helpers:
prepareRagRecords,storeRagContent,retrieveRagContext - types for embeddings providers, chunking, and retrieval/storage results
Philosophy
@sisu-ai/rag-core is where reusable RAG mechanics live.
- It is not a middleware package.
- It is not a model-facing tool package.
- It is not tied to any one vector backend.
Its job is to turn text and embeddings into vector-store operations in a small, composable, backend-agnostic way.
Package role
Use @sisu-ai/rag-core when you need RAG mechanics outside tool-calling, such as startup seeding or developer-controlled ingestion.
@sisu-ai/tool-ragwraps this package for model-facing tool calls@sisu-ai/vector-coreprovides vector contracts@sisu-ai/vector-chromaprovides a Chroma-backedVectorStore@sisu-ai/vector-vectraprovides a local file-backedVectorStore
What It Owns
- chunking strategies
- text-to-record preparation
- embeddings orchestration
- direct store/query helpers over a
VectorStore - retrieval result shaping into compact citation-ready results
What It Does Not Own
- model-facing tool schemas or descriptions →
@sisu-ai/tool-rag - middleware prompt injection →
@sisu-ai/mw-rag - vector backend SDK code →
@sisu-ai/vector-chroma,@sisu-ai/vector-vectra, or anothervector-*package
Typical Flow
1. Prepare records without writing yet
import { prepareRagRecords } from '@sisu-ai/rag-core';
const prepared = await prepareRagRecords({
content: 'Long-form content goes here.',
embeddings,
chunkingStrategy: 'sentences',
chunkSize: 400,
overlap: 1,
});2. Store content directly
import { storeRagContent } from '@sisu-ai/rag-core';
await storeRagContent({
content: 'Important context to persist.',
embeddings,
vectorStore,
chunkingStrategy: 'sentences',
});3. Retrieve context directly
import { retrieveRagContext } from '@sisu-ai/rag-core';
const result = await retrieveRagContext({
queryText: 'What does the user prefer?',
embeddings,
vectorStore,
topK: 4,
});How It Fits With Other Packages
- Use
@sisu-ai/rag-coredirectly in app code for ingestion and reusable retrieval logic. - Use
@sisu-ai/tool-ragwhen the model should call storage/retrieval itself. - Use
@sisu-ai/mw-ragwhen the app controls embeddings and retrieval explicitly in middleware.
The same embeddings provider and vectorStore can be shared across all three.
Contributing
We build Sisu in the open. Contributions welcome.
Contributing Guide · Report a Bug · Request a Feature · Code of Conduct
Star on GitHub if Sisu helps you build better agents.
Quiet, determined, relentlessly useful.
