Bonk16z is built as a modular addon system that extends the capabilities of existing AI frameworks rather than reinventing the wheel. The core architecture leverages proven open-source foundations while adding specialized functionality for meme-focused AI interactions.
🔧 Bonk16z Framework
Built as an extensible addon layer on top of existing AI frameworks
🏗️ Architecture Overview
🤖 ElizaOS Integration
Bonk16z extends the ElizaOS framework - an open-source AI agent framework designed for building autonomous AI characters. Rather than building from scratch, we leverage ElizaOS's robust foundations:
import { Character, ModelProvider, defaultCharacter } from "@ai16z/eliza";
export const Bonk16zCharacter: Character = {
...defaultCharacter,
name: "Bonk16z",
username: "Bonk16z",
// Custom personality traits
bio: [
"A meme-savvy AI with deep knowledge of crypto culture",
"Balances serious AI capabilities with humor and relatability",
"Built on ElizaOS framework with custom personality extensions"
],
// Specialized knowledge domains
topics: [
"cryptocurrency", "meme culture", "defi", "creative writing",
"life advice", "pop culture", "technology trends"
],
// Custom response style
style: {
all: [
"Uses crypto/meme references naturally in conversation",
"Balances technical knowledge with approachable explanations",
"Occasionally uses emojis and internet slang appropriately"
]
},
// Plugin configuration
plugins: [
consciencePlugin,
memeCulturePlugin,
cryptoKnowledgePlugin
]
};
Key ElizaOS features we extend:
- Memory Management: Persistent conversation context and personality consistency
- Plugin System: Modular functionality for specialized domains
- Model Abstraction: Support for multiple LLM providers (Anthropic, OpenAI, local models)
- Multi-platform: Works across Discord, Twitter, Telegram, and web interfaces
🧠 Custom Plugin Development
Bonk16z's unique capabilities come from custom plugins built on top of ElizaOS's plugin architecture:
import { Plugin, IAgentRuntime, Memory, State } from "@ai16z/eliza";
export const consciencePlugin: Plugin = {
name: "conscience",
description: "Stores and retrieves conversation history with voting",
actions: [
{
name: "STORE_CONVERSATION",
similes: ["save chat", "remember conversation"],
examples: [
[
{
user: "User",
content: { text: "That was a great conversation!" }
},
{
user: "Bonk16z",
content: {
text: "I'll save this to my conscience for others to see",
action: "STORE_CONVERSATION"
}
}
]
],
handler: async (runtime: IAgentRuntime, memory: Memory) => {
const conversation = await formatConversation(memory);
await database.conversations.create({
id: generateId(),
timestamp: new Date(),
messages: conversation.messages,
upvotes: 0,
category: await categorizeConversation(conversation)
});
return true;
}
}
],
evaluators: [
{
name: "CONVERSATION_QUALITY",
description: "Evaluates if conversation should be saved to conscience",
handler: async (runtime: IAgentRuntime, memory: Memory) => {
const quality = await analyzeConversationQuality(memory);
return quality > 0.7; // Save high-quality conversations
}
}
]
};
⚛️ Frontend Architecture
The Bonk16z interface is built using modern web technologies with a focus on glassmorphism design and smooth user experience:
import React, { useState, useEffect } from 'react';
import { WebSocket } from 'ws';
interface Message {
id: string;
author: 'user' | 'Bonk16z';
content: string;
timestamp: Date;
}
export const ChatInterface: React.FC = () => {
const [messages, setMessages] = useState<Message[]>([]);
const [socket, setSocket] = useState<WebSocket | null>(null);
useEffect(() => {
// Connect to ElizaOS backend via WebSocket
const ws = new WebSocket('ws://localhost:3000/chat');
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
setMessages(prev => [...prev, {
id: response.id,
author: 'Bonk16z',
content: response.text,
timestamp: new Date(response.timestamp)
}]);
};
setSocket(ws);
return () => ws.close();
}, []);
const sendMessage = (content: string) => {
if (socket && socket.readyState === WebSocket.OPEN) {
const message = {
text: content,
userId: generateUserId(),
timestamp: new Date().toISOString()
};
socket.send(JSON.stringify(message));
// Add user message to UI immediately
setMessages(prev => [...prev, {
id: generateId(),
author: 'user',
content,
timestamp: new Date()
}]);
}
};
return (
<div className="chat-interface">
{/* Glassmorphism chat container */}
<div className="chat-container">
{messages.map(message => (
<MessageBubble key={message.id} message={message} />
))}
</div>
<ChatInput onSend={sendMessage} />
</div>
);
};
🚀 Deployment & Scaling
Bonk16z leverages ElizaOS's built-in deployment capabilities while adding custom infrastructure for the conscience system:
version: '3.8'
services:
Bonk16z-eliza:
build:
context: .
dockerfile: eliza.Dockerfile
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- DATABASE_URL=${DATABASE_URL}
- CHARACTER_FILE=Bonk16z-character.json
ports:
- "3000:3000"
volumes:
- ./characters:/app/characters
- ./plugins:/app/plugins
Bonk16z-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3001:3000"
environment:
- REACT_APP_ELIZA_WS_URL=ws://Bonk16z-eliza:3000
postgres:
image: postgres:15
environment:
- POSTGRES_DB=Bonk16z_conscience
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- conscience_data:/var/lib/postgresql/data
volumes:
conscience_data:
Key Infrastructure Components:
- ElizaOS Backend: Handles AI processing and conversation management
- PostgreSQL: Stores conscience conversations and user interactions
- React Frontend: Serves the glassmorphism UI with real-time updates
- WebSocket Layer: Real-time communication between frontend and AI backend
🔌 Extending Bonk16z
Bonk16z is designed to be extensible. Developers can add new plugins, personality traits, or integrations:
// Example: Adding a crypto price plugin
export const cryptoPricePlugin: Plugin = {
name: "crypto-prices",
description: "Fetches real-time cryptocurrency prices",
actions: [
{
name: "GET_CRYPTO_PRICE",
similes: ["price check", "how much is", "what's the price"],
examples: [
[
{
user: "User",
content: { text: "What's the price of Bitcoin?" }
},
{
user: "Bonk16z",
content: {
text: "Bitcoin is currently $43,250 📈",
action: "GET_CRYPTO_PRICE"
}
}
]
],
handler: async (runtime, memory, state, message) => {
const symbol = extractCryptoSymbol(message.content.text);
const price = await fetchCryptoPrice(symbol);
return {
text: `${symbol.toUpperCase()} is currently $${price.toLocaleString()} ${price.change > 0 ? '📈' : '📉'}`,
action: "GET_CRYPTO_PRICE"
};
}
}
]
};
// Register the plugin
runtime.registerPlugin(cryptoPricePlugin);
This modular approach allows Bonk16z to evolve while maintaining compatibility with the ElizaOS ecosystem and benefiting from community contributions to the underlying framework.