FABRICON
AI agents with composable intelligence - the first framework combining GPT-4, Claude, and custom models for complex creation tasks. Production-ready, TypeScript-first architecture.
// Fabricon's Multi-Model Architecture
// Intelligent routing based on task complexity
interface FabriconCore {
// Model orchestration
router: ModelRouter;
// Context management
contexts: ContextManager;
// Memory persistence
memory: PersistentMemory;
// Action handlers
actions: ActionRegistry;
}
// Automatic model selection
class ModelRouter {
selectModel(task: Task): AIModel {
if (task.type === 'code_generation') return GPT4;
if (task.type === 'analysis') return Claude;
if (task.type === 'research') return GPT5;
return this.customModel || GPT4;
}
}
// Context isolation & composition
const fabricon = createFabricon({
contexts: [
codeContext.use([memoryContext, toolsContext]),
analysisContext.use([documentContext])
]
});
Intelligent Model Selection
Automatically routes tasks to the optimal AI model - GPT-4 for code, Claude for analysis, custom models for specialized tasks
Persistent Memory
Each agent remembers context across sessions - true stateful intelligence for long-running projects
Context Composition
Combine isolated workspaces for modular agent behaviors - build complex systems from simple components
Type-Safe Throughout
Full IntelliSense for contexts, actions, memory, and schemas - catch errors before runtime
Real-Time Streaming
Stream responses token-by-token for immediate feedback - perfect for interactive applications
Parallel Execution
Run multiple AI models simultaneously - combine outputs for enhanced results
// Initialize Fabricon with GPT-4
import { createFabricon } from '@fabricon/core';
import { openai } from '@ai-sdk/openai';
const fabricon = createFabricon({
model: openai('gpt-4o'),
contexts: [chatContext],
});
// Simple agent
const chatContext = context({
type: "chat",
create: () => ({ messages: [] }),
setActions: (state) => ({
sendMessage: async (content: string) => {
state.messages.push({ role: 'user', content });
const response = await fabricon.generate(content);
state.messages.push({ role: 'assistant', content: response });
return response;
}
})
});
// Use the agent
await chatContext.actions.sendMessage("Create a React component");
Context-Based Architecture
Fabricon uses isolated contexts that can be composed together. Each context has its own state, actions, and can leverage different AI models automatically.
Initialize a new Fabricon instance with AI model configuration, contexts, and optional memory persistence.
Create an isolated context with state management, actions, and optional composition with other contexts.
Generate content using the configured AI model with automatic model selection based on task complexity.
Compose multiple contexts together. Child contexts inherit state and actions from parent contexts.
+ all AI SDK providers