
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
🏠Teach AI to understand natural language like a patient tutor. Advanced embedding-based function calling with semantic understanding, confidence scoring, and natural language parameter extraction.
Teach AI to understand natural language like a patient tutor. Advanced embedding-based function calling with semantic understanding, confidence scoring, and natural language parameter extraction.
Why "Homeschool"? Just like homeschooling provides personalized, one-on-one education that adapts to how each student learns best, this library teaches AI to understand your specific vocabulary, context, and intent. It learns your patterns, builds confidence gradually, and grows smarter with each interaction.
npm install homeschool @xenova/transformers
import { SemanticFunctionCaller, exampleTools } from 'homeschool';
// Initialize the caller
const caller = new SemanticFunctionCaller({
verbose: true,
defaultConfidenceThreshold: 0.25,
});
// Register tools
caller.registerTools(exampleTools);
// Execute function calling
const result = await caller.execute('make the background orange');
if (result.success) {
console.log(`Tool: ${result.tool}`);
console.log(`Parameters:`, result.parameters);
console.log(`Confidence: ${(result.confidence * 100).toFixed(1)}%`);
}
import { Tool } from 'homeschool';
const customTool: Tool = {
name: 'playMusic',
description: 'Plays music or audio content',
contexts: [
'audio and entertainment',
'media control and playback',
'music streaming and sound',
],
intentPatterns: [
'user wants to play audio',
'user wants to listen to music',
'user wants to start playback',
],
parameters: {
genre: {
type: 'semantic_category',
semanticCandidates: ['rock', 'pop', 'jazz', 'classical', 'electronic'],
fallback: 'pop',
},
volume: {
type: 'semantic_number',
semanticCandidates: ['quiet', 'low', 'medium', 'high', 'loud'],
fallback: 'medium',
},
},
};
caller.registerTools([customTool]);
const result = await caller.execute('remember to call mom', {
confidenceThreshold: 0.3,
});
const result = await caller.execute('make it blue', {
gutInstinct: true, // Lower confidence threshold, trusts model intuition
});
const result = await caller.executeFirstInstinct(
'take a note about the meeting',
);
// Bypasses confidence checks completely, trusts top choice
Extracts colors using semantic similarity:
{
type: 'semantic_color',
semanticCandidates: ['red', 'blue', 'green', /* ... */],
modifierCandidates: ['light', 'dark', 'bright'],
fallback: 'blue'
}
Extracts categories through contextual understanding:
{
type: 'semantic_category',
semanticCandidates: ['work', 'personal', 'ideas', /* ... */],
fallback: 'general'
}
Isolates content from command words:
{
type: 'extracted_content',
extractionStrategy: 'semantic_content_isolation'
}
const caller = new SemanticFunctionCaller({
embeddingModel: 'Xenova/all-MiniLM-L6-v2', // Hugging Face model
defaultConfidenceThreshold: 0.25, // Confidence threshold
enableCaching: true, // Cache embeddings
verbose: false, // Debug logging
});
interface ExecutionResult {
success: boolean;
tool?: string; // Selected tool name
parameters?: Record<string, any>; // Extracted parameters
confidence?: number; // Confidence score (0-1)
reasoning?: Array<{
// Detailed reasoning
type: string;
text: string;
score: number;
}>;
mode?: 'standard' | 'first_instinct';
reason?: string; // Failure reason if success = false
}
// "remember to buy groceries and pick up dry cleaning"
{
tool: 'takeNote',
parameters: {
note: 'buy groceries and pick up dry cleaning',
category: 'personal'
},
confidence: 0.847
}
// "make the page look more vibrant and energetic"
{
tool: 'changeBackgroundColor',
parameters: {
color: 'vibrant orange'
},
confidence: 0.721
}
// "show the user a welcome message"
{
tool: 'displayText',
parameters: {
text: 'welcome message'
},
confidence: 0.892
}
import { extractSemanticColor, extractSemanticContent } from 'homeschool';
// Use extractors directly
const color = await extractSemanticColor(
'make it crimson',
colorConfig,
embedder,
);
const content = await extractSemanticContent('display hello world', embedder);
const queries = ['make it blue', 'remember the meeting', 'show welcome text'];
const results = await Promise.all(
queries.map((query) => caller.execute(query)),
);
console.log(`Cache size: ${caller.getCacheSize()}`);
caller.clearCache(); // Clear embedding cache if needed
Traditional regex approach:
// Brittle regex patterns
if (/make.*background.*blue/i.test(query)) {
return { tool: 'changeColor', color: 'blue' };
}
Semantic approach:
// Robust semantic understanding
const result = await caller.execute(query);
// Handles: "make it blue", "blue background", "change to blue", etc.
Use the automated release scripts for easy publishing:
# Patch release (bug fixes, docs) - 0.1.1 → 0.1.2
npm run release
# Minor release (new features) - 0.1.1 → 0.2.0
npm run publish:minor
# Major release (breaking changes) - 0.1.1 → 1.0.0
npm run publish:major
These scripts automatically:
See scripts/README.md for more details.
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see the LICENSE file for details.
Made with care for developers who want to homeschool their AI to truly understand human language.
FAQs
🏠Teach AI to understand natural language like a patient tutor. Advanced embedding-based function calling with semantic understanding, confidence scoring, and natural language parameter extraction.
The npm package homeschool receives a total of 2 weekly downloads. As such, homeschool popularity was classified as not popular.
We found that homeschool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.