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 ---
EmbeddingProviderandLlmProvidertraits 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 retrievalspt-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
| Type | Description |
|---|---|
CognitiveEngine | Main engine orchestrating cognitive operations |
CognitiveError | Crate error type |
CognitiveResult<T> | Result alias |
Key Traits
| Trait | Description |
|---|---|
EmbeddingProvider | Generate vector embeddings from text |
LlmProvider | Run LLM inference for think operations |
Modules
| Module | Description |
|---|---|
engine | CognitiveEngine and configuration |
memory | Vector memory store operations |
traits | Platform injection traits |
types | Shared data types |