skopik

Search & Memory Recall

Skopik features built-in search and knowledge retrieval across all platform resources. Rather than managing third-party vector databases or custom chunking pipelines, Skopik automatically indexes Agent brain files, durable memories, Session transcripts, and final deliverables into a unified search index.

Automatic zero-config indexing

Indexing is fully implicit:

  • Writing or updating a file via the Files API automatically queues background chunking, embedding generation, and lexical tokenization.
  • Deleting a file automatically removes its associated chunks from search.
  • Closing or updating Session transcripts automatically indexes new turn dialogue.

No manual indexing endpoints or ETL pipelines are needed.

Search modes

Mode Description Best For
hybrid (Default) Combines dense semantic vector embeddings with sparse lexical BM25 keyword matching. General knowledge retrieval, question answering, and memory lookup.
vector Pure dense vector cosine similarity search. Semantic matching where exact keywords may differ.
lexical Pure BM25 text keyword matching. Exact string matches, error codes, identifiers, and symbol lookups.

Target-scoped search

Query specific resource domains using targets:

const response = await skopik.search.search({
	query: 'rate limiting architecture in enterprise API gateway',
	targets: ['documents', 'memories'],
	mode: 'hybrid',
	limit: 10,
	highlight: true,
})

// Access results grouped by target
const docHits = response.results.documents?.hits ?? []
const memoryHits = response.results.memories?.hits ?? []

for (const hit of docHits) {
	console.log(`Document: ${hit.path} (Score: ${hit.score})`)
	console.log(`  Snippet: ${hit.text}`)
	console.log(`  Highlights:`, hit.highlights)
}

Search target descriptions

Target Content Searched
documents Reference files in Agent brains, Template files, and Session deliverables (output/).
memories Agent long-term memory chunks (MEMORY.md) and synthesized insights.
transcripts Historical multi-turn dialogue from Session transcripts.
entities Platform resources (Agent profiles, Templates, and Skills).

Memory recall with context positioning

When searching Agent memories, pass a context object containing agentId or sessionId. Skopik automatically traverses the full organizational hierarchy (session → agent → user → org) to rank memories most relevant to that specific execution context:

const response = await skopik.search.search({
	query: 'user preferred coding style and framework conventions',
	targets: ['memories'],
	context: {
		agentId: agent.agentId,
		sessionId: session.sessionId,
	},
	limit: 5,
})

for (const memory of response.results.memories?.hits ?? []) {
	console.log(`[Memory] ${memory.path}: ${memory.text}`)
}

Reference search for precise code blocks

Use skopik.search.references() to find exact code symbols, configuration keys, or policy references across files with character-level offsets and line ranges:

const response = await skopik.search.references({
	query: 'export function createClientTool',
	mode: 'indexed',
	caseSensitive: true,
	wholeWord: false,
	limit: 20,
})

for (const hit of response.hits) {
	console.log(`File: ${hit.path}`)
	console.log(`  Lines: ${hit.headingPath?.join(' > ') ?? 'root'}`)
	console.log(`  Character Range: ${hit.matchStart} - ${hit.matchEnd}`)
	console.log(`  Snippet:\n${hit.snippet}`)
}

Filter scopes

Filter searches to specific agents, session workspaces, or folder paths:

const response = await skopik.search.search({
	query: 'database migration policy',
	filters: {
		scope: 'agent',
		agentId: agent.agentId,
		pathPrefix: 'references/database/',
	},
	limit: 10,
})

API reference

SDK Method HTTP Endpoint Description
search.search(input) POST /search Search documents, memories, transcripts, or entities.
search.references(input) POST /search/references Exact block and code reference search with offsets.