Skip to content

spt-cognitive

Platform-agnostic cognitive engine --- think, recall, remember, evolve, cycle

Overview

spt-cognitive is the core cognitive engine for SmartBrain. It provides think/recall/remember/evolve/cycle operations over a vector memory store with adaptive learning via SONA. Platform-specific functionality (embedding models, LLM inference, file access) is injected through traits, keeping the crate fully platform-agnostic.

Key Features

  • Cognitive Operations --- think, recall, remember, evolve, and cycle as first-class operations
  • Vector Memory Store --- backed by spt-core's VectorDB with HNSW indexing
  • Trait-Based Injection --- EmbeddingProvider and LlmProvider traits for platform-specific backends
  • Adaptive Learning --- integrates spt-sona for pattern recognition and learning loops
  • Platform Agnostic --- no OS-specific code; works on macOS, iOS, visionOS, Windows, Android

Dependencies

Key internal dependencies:

  • spt-core (storage, hnsw) --- vector database for memory storage and retrieval
  • spt-sona --- adaptive learning and pattern recognition

Usage

rust
use spt_cognitive::{CognitiveEngine, EmbeddingProvider, LlmProvider};

// Implement EmbeddingProvider and LlmProvider for your platform,
// then construct the engine:
// let engine = CognitiveEngine::new(config, embedding, llm);

API Reference

Core Types

TypeDescription
CognitiveEngineMain engine orchestrating cognitive operations
CognitiveErrorCrate error type
CognitiveResult<T>Result alias

Key Traits

TraitDescription
EmbeddingProviderGenerate vector embeddings from text
LlmProviderRun LLM inference for think operations

Modules

ModuleDescription
engineCognitiveEngine and configuration
memoryVector memory store operations
traitsPlatform injection traits
typesShared data types

Released under the MIT License.