Skip to content

@venturekit-pro/ai API

FunctionDescription
createEmbedder(config)Create an embedder for generating vectors
createEmbeddingConfig(options)Create embedding configuration

Embedder interface:

MethodDescription
embed(text: string)Generate a single vector
embedBatch(texts: string[])Generate vectors for multiple texts
FunctionDescription
createVectorStore(config)Create a vector store instance
createVectorStoreConfig(options)Create vector store configuration

VectorStore interface:

MethodDescription
upsert(items)Insert or update vectors
query(vector, options)Query similar vectors
FunctionDescription
createRagPipeline(config)Create a RAG pipeline
createRagConfig(options)Create RAG configuration
chunkText(text, options)Split text into chunks

RagPipeline interface:

MethodDescription
ingest(chunks)Ingest document chunks
retrieve(query, options)Retrieve relevant context
FunctionDescription
createAgent(config)Create an AI agent
createAgentConfig(options)Create agent configuration
defineTool(definition)Define a tool for agent use

Agent interface:

MethodDescription
run(prompt)Run the agent with a user prompt

AI-related types are exported from ./types/index.js, including embedding configs, vector store configs, RAG configs, agent configs, and tool definitions.

ConstantDescription
DEFAULT_EMBEDDING_CONFIGDefault embedding configuration
DEFAULT_VECTOR_STORE_CONFIGDefault vector store configuration
DEFAULT_RAG_CONFIGDefault RAG configuration
DEFAULT_AGENT_CONFIGDefault agent configuration