feat: remove legacy ImportManager, standardize getStats() API

- Removed ImportManager class and exports (use brain.import() instead)
- Fixed all documentation: getStatistics() → getStats()
- Updated 41 files across codebase for consistency
- Removed ImportManager section from API docs
- Added v3.30.0 migration guide to CHANGELOG

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David Snelling 2025-10-09 11:40:31 -07:00
parent 68c989e4f7
commit 58daf09403
31 changed files with 87 additions and 481 deletions

View file

@ -279,8 +279,8 @@ export class NeuralAPI {
*/
async outliers(threshold: number = 0.3): Promise<string[]> {
// Get all items
const stats = await this.brain.getStatistics()
const totalItems = stats.nounCount
const stats = this.brain.getStats()
const totalItems = stats.entities.total
if (totalItems === 0) return []
@ -539,8 +539,8 @@ export class NeuralAPI {
// Enterprise clustering implementations
private async getOptimalClusteringLevel(): Promise<number> {
// Analyze dataset size and return optimal HNSW level
const stats = await this.brain.getStatistics()
const itemCount = stats.nounCount
const stats = this.brain.getStats()
const itemCount = stats.entities.total
if (itemCount < 1000) return 0
if (itemCount < 10000) return 1
@ -551,8 +551,8 @@ export class NeuralAPI {
private async getHNSWLevelNodes(level: number): Promise<any[]> {
// Get nodes from specific HNSW level
// For now, use search to get a representative sample
const stats = await this.brain.getStatistics()
const sampleSize = Math.min(100, Math.floor(stats.nounCount / (level + 1)))
const stats = this.brain.getStats()
const sampleSize = Math.min(100, Math.floor(stats.entities.total / (level + 1)))
// Use search with a general query to get representative items
const queryVector = await this.brain.embed('data information content')
@ -568,8 +568,8 @@ export class NeuralAPI {
private async getSample(size: number, strategy: string): Promise<any[]> {
// Use search to get a sample of items
const stats = await this.brain.getStatistics()
const maxSize = Math.min(size * 3, stats.nounCount) // Get more than needed for sampling
const stats = this.brain.getStats()
const maxSize = Math.min(size * 3, stats.entities.total) // Get more than needed for sampling
const queryVector = await this.brain.embed('sample data content')
const allItems = await this.brain.search(queryVector, maxSize)