Skip to main content
Glama
vector-store.service.ts1.38 kB
import { Injectable } from '@nestjs/common'; import { rag } from '@snakagent/database/queries'; @Injectable() export class VectorStoreService { /** * List all documents for a specific agent (API-specific function) * @param agentId - The agent ID * @param userId - The user ID for ownership verification * @returns Promise<Array> Array of document metadata */ async listDocuments( agentId: string, userId: string ): Promise<rag.DocumentMetadata[]> { return await rag.listDocuments(agentId, userId); } /** * Get a specific document and its chunks (API-specific function) * @param agentId - The agent ID * @param documentId - The document ID * @param userId - The user ID for ownership verification * @returns Promise<Array> Array of document chunks */ async getDocument( agentId: string, documentId: string, userId: string ): Promise<rag.DocumentChunk[]> { return await rag.getDocument(agentId, documentId, userId); } /** * Delete a specific document (API-specific function) * @param agentId - The agent ID * @param documentId - The document ID * @param userId - The user ID for ownership verification */ async deleteDocument( agentId: string, documentId: string, userId: string ): Promise<void> { return await rag.deleteDocument(agentId, documentId, userId); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KasarLabs/snak'

If you have feedback or need assistance with the MCP directory API, please join our Discord server