Class: ApiService

ApiService()

API Service for Semantic Memory Workbench Handles communication with MCP HTTP server endpoints

Constructor

new ApiService()

Source:

Classes

ApiService

Methods

(async) ask(params) → {Promise.<Object>}

ASK - Query stored knowledge

.

ASK - Query stored knowledge

Parameters:
Name Type Description
params Object

Ask parameters

Properties
Name Type Description
question string

Question to ask

mode string

Mode: 'basic' | 'standard' | 'comprehensive'

useContext boolean

Whether to use context

useHyDE boolean

Whether to use HyDE enhancement

useWikipedia boolean

Whether to use Wikipedia enhancement

useWikidata boolean

Whether to use Wikidata enhancement

Source:
Returns:

Ask result with answer and related content

Type
Promise.<Object>

(async) augment(params) → {Promise.<Object>}

AUGMENT - Run operations on content

.

AUGMENT - Run operations on content

Parameters:
Name Type Description
params Object

Augment parameters

Properties
Name Type Description
target string

Target content to analyze

operation string

Operation: 'auto' | 'concepts' | 'attributes' | 'relationships'

options Object

Additional options

Source:
Returns:

Augment result with extracted concepts/attributes

Type
Promise.<Object>

(async) batch(requests) → {Promise.<Array>}

Batch multiple API calls

.

Batch multiple API calls

Parameters:
Name Type Description
requests Array

Array of {method, params} objects

Source:
Returns:

Array of results

Type
Promise.<Array>

(async) chat(params) → {Promise.<Object>}

CHAT - Interactive chat with slash command support and LLM inference

.

CHAT - Interactive chat with slash command support and LLM inference

Parameters:
Name Type Description
params Object

Chat parameters

Properties
Name Type Description
message string

User message or command

context Object

Optional conversation context

Source:
Returns:

Chat result with response content and routing information

Type
Promise.<Object>

(async) enhancedChat(params) → {Promise.<Object>}

ENHANCED CHAT - Enhanced query with HyDE, Wikipedia, and Wikidata

.

ENHANCED CHAT - Enhanced query with HyDE, Wikipedia, and Wikidata

Parameters:
Name Type Description
params Object

Enhanced chat parameters

Properties
Name Type Description
query string

Query to search with enhancements

useHyDE boolean

Whether to use HyDE enhancement

useWikipedia boolean

Whether to use Wikipedia enhancement

useWikidata boolean

Whether to use Wikidata enhancement

Source:
Returns:

Enhanced chat result

Type
Promise.<Object>

(async) fade_memory(params) → {Promise.<Object>}

FADE_MEMORY - Gradually reduce memory visibility for smooth context transitions

.

FADE_MEMORY - Gradually reduce memory visibility for smooth context transitions

Parameters:
Name Type Description
params Object

Fade memory parameters

Properties
Name Type Description
domain string

Domain to fade

fadeFactor number

Fade factor (0-1)

transition string

Transition type: 'smooth' | 'immediate'

preserveInstructions boolean

Whether to preserve instruction memories

Source:
Returns:

Fade memory result

Type
Promise.<Object>

(async) forget(params) → {Promise.<Object>}

FORGET - Fade memory visibility using navigation rather than deletion

.

FORGET - Fade memory visibility using navigation rather than deletion

Parameters:
Name Type Description
params Object

Forget parameters

Properties
Name Type Description
target string

Target memory identifier or domain

strategy string

Forgetting strategy: 'fade' | 'context_switch' | 'temporal_decay'

fadeFactor number

Fade factor for visibility reduction (0-1)

Source:
Returns:

Forget result

Type
Promise.<Object>

getErrorMessage(error) → {string}

Get formatted error message from API response

.

Get formatted error message from API response

Parameters:
Name Type Description
error Error

Error object

Source:
Returns:

User-friendly error message

Type
string

(async) getHealth() → {Promise.<Object>}

Check server health status

.

Check server health status

Source:
Returns:

Health status

Type
Promise.<Object>

(async) getState() → {Promise.<Object>}

Get current ZPT navigation state

.

Get current ZPT navigation state

Source:
Returns:

Current state object

Type
Promise.<Object>

(async) inspectAllData(details) → {Promise.<Object>}

INSPECT ALL DATA - Get complete system state information

.

INSPECT ALL DATA - Get complete system state information

Parameters:
Name Type Default Description
details boolean true

Include detailed information

Source:
Returns:

Complete inspection data

Type
Promise.<Object>

(async) inspectConcepts(details) → {Promise.<Object>}

INSPECT CONCEPTS - Get concepts and embeddings information

.

INSPECT CONCEPTS - Get concepts and embeddings information

Parameters:
Name Type Default Description
details boolean true

Include detailed information

Source:
Returns:

Concepts inspection data

Type
Promise.<Object>

(async) inspectSession(details) → {Promise.<Object>}

INSPECT SESSION - Get session state and cache information

.

INSPECT SESSION - Get session state and cache information

Parameters:
Name Type Default Description
details boolean true

Include detailed information

Source:
Returns:

Session inspection data

Type
Promise.<Object>

(async) makeRequest()

Make HTTP request with error handling and session management

.

Make HTTP request with error handling and session management

Source:

(async) pan(params) → {Promise.<Object>}

PAN - Set domain filters for navigation

.

PAN - Set domain filters for navigation

Parameters:
Name Type Description
params Object

Pan parameters

Properties
Name Type Description
domains Array.<string>

Subject domains to filter by

keywords Array.<string>

Keywords to filter by

entities Array.<string>

Entity names to filter by

temporal Object

Temporal filtering parameters

query string

Optional query to update

Source:
Returns:

Pan result with updated filters

Type
Promise.<Object>

(async) project_context(params) → {Promise.<Object>}

PROJECT_CONTEXT - Manage project-specific memory domains

.

PROJECT_CONTEXT - Manage project-specific memory domains

Parameters:
Name Type Description
params Object

Project context parameters

Properties
Name Type Description
projectId string

Project identifier

action string

Project action: 'create' | 'switch' | 'list' | 'archive'

metadata Object

Project metadata including name, description, and technologies

Source:
Returns:

Project context result

Type
Promise.<Object>

(async) recall(params) → {Promise.<Object>}

RECALL - Retrieve memories based on query and domain filters with relevance scoring

.

RECALL - Retrieve memories based on query and domain filters with relevance scoring

Parameters:
Name Type Description
params Object

Recall parameters

Properties
Name Type Description
query string

Search query for memories

domains Array.<string>

Domain filters

timeRange Object

Temporal filters {start, end}

relevanceThreshold number

Minimum relevance score (0-1)

maxResults number

Maximum results to return (1-100)

Source:
Returns:

Recall result with memories

Type
Promise.<Object>

(async) remember(params) → {Promise.<Object>}

REMEMBER - Store content in specific memory domain with importance weighting

.

REMEMBER - Store content in specific memory domain with importance weighting

Parameters:
Name Type Description
params Object

Remember parameters

Properties
Name Type Description
content string

Content to remember

domain string

Memory domain: 'user' | 'project' | 'session' | 'instruction'

domainId string

Domain identifier (optional)

importance number

Importance weighting (0-1)

metadata Object

Additional metadata including tags and category

Source:
Returns:

Remember result

Type
Promise.<Object>

(async) tell(params) → {Promise.<Object>}

TELL - Store knowledge and concepts

.

TELL - Store knowledge and concepts

Parameters:
Name Type Description
params Object

Tell parameters

Properties
Name Type Description
content string

Content to store

type string

Type: 'concept' | 'interaction' | 'document'

lazy boolean

Whether to store without immediate processing

metadata Object

Optional metadata

Source:
Returns:

Tell result

Type
Promise.<Object>

(async) testConnection() → {Promise.<boolean>}

Test connection to API server

.

Test connection to API server

Source:
Returns:

True if connected

Type
Promise.<boolean>

(async) tilt(params) → {Promise.<Object>}

TILT - Set view filter/representation style

.

TILT - Set view filter/representation style

Parameters:
Name Type Description
params Object

Tilt parameters

Properties
Name Type Description
style string

Representation style: 'keywords' | 'embedding' | 'graph' | 'temporal'

query string

Optional query to update

Source:
Returns:

Tilt result with updated view

Type
Promise.<Object>

(async) uploadDocument(params)

UPLOAD DOCUMENT - Upload and process document file

.

UPLOAD DOCUMENT - Upload and process document file

Parameters:
Name Type Description
params Object

Upload parameters

Properties
Name Type Description
fileUrl string

Data URL of the file

filename string

Original filename

mediaType string

MIME type of the file

documentType string

Document type (pdf, text, markdown)

metadata Object

Additional metadata

Source:

withTimeout(options, timeoutMs) → {Object}

Create request options with timeout

.

Create request options with timeout

Parameters:
Name Type Default Description
options Object

Base options

timeoutMs number 30000

Timeout in milliseconds

Source:
Returns:

Options with timeout

Type
Object

(async) zoom(params) → {Promise.<Object>}

ZOOM - Set abstraction level for navigation

.

ZOOM - Set abstraction level for navigation

Parameters:
Name Type Description
params Object

Zoom parameters

Properties
Name Type Description
level string

Abstraction level: 'entity' | 'unit' | 'text' | 'community' | 'corpus'

query string

Optional query to update

Source:
Returns:

Zoom result with updated state

Type
Promise.<Object>

(async) zptNavigate(params) → {Promise.<Object>}

ZPT NAVIGATE - Execute navigation with zoom/pan/tilt parameters

.

ZPT NAVIGATE - Execute navigation with zoom/pan/tilt parameters

Parameters:
Name Type Description
params Object

Navigation parameters

Properties
Name Type Description
query string

Navigation query

zoom string

Zoom level (entity, unit, text, community, corpus)

pan Object

Pan filters {domains, keywords}

tilt string

Tilt style (keywords, embedding, graph, temporal)

Source:
Returns:

Navigation results

Type
Promise.<Object>