Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md


VoltAgent is an open source TypeScript framework for building and orchestrating AI agents.
Escape the limitations of no-code builders and the complexity of starting from scratch.

npm version Contributor Covenant Discord Twitter Follow


VoltAgent: Embeddings + Vector Search

This example shows how to enable semantic memory using embeddings and a vector database. Messages are embedded on save, stored in LibSQL via LibSQLVectorAdapter, and retrieved with semantic search when the agent answers.

Try Example

npm create voltagent-app@latest -- --example with-vector-search

Highlights

  • OpenAI embeddings via AI SDK (text-embedding-3-small)
  • Vector DB via LibSQLVectorAdapter
  • Automatic semantic recall in Agent when vector support exists
  • Optional raw vector search API (memory.searchSimilar)

Snippet

import { Agent, Memory, VoltAgent } from "@voltagent/core";
import { LibSQLMemoryAdapter, LibSQLVectorAdapter } from "@voltagent/libsql";
import { honoServer } from "@voltagent/server-hono";

const memory = new Memory({
  storage: new LibSQLMemoryAdapter(),
  embedding: "openai/text-embedding-3-small",
  vector: new LibSQLVectorAdapter(),
});

const agent = new Agent({ name: "Semantic Memory Agent", model: "openai/gpt-4o-mini", memory });
new VoltAgent({ agents: { agent }, server: honoServer({ port: 3142 }) });

Run Locally

  1. Copy .env.example to .env and set OPENAI_API_KEY.
  2. Install deps and start:
pnpm i
pnpm dev

To observe semantic recall, seed a conversation with prior messages (see commented demo in src/index.ts), then ask a related question. The agent will merge relevant past messages using semantic search.