NanoCog
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
A super tiny implementation of OpenCog as a chatbot with the personality traits and basic cognitive architecture features of OpenCog. Designed to give users a simulated experience of what interactions will be like when the full OpenCog model comes online.
- Mini-AtomSpace: Knowledge representation with atoms and relationships
- ECAN: Economic attention allocation with STI (Short Term Interest) and LTI (Long Term Interest)
- Memory Systems: Semantic, episodic, and procedural memory formation
- Pattern Recognition: Learning from interactions and building understanding
- Probabilistic Reasoning: Uncertainty-aware decision making
- MOSES-inspired: Evolutionary search for optimal responses
- Hyper-intelligent with playful inquiry disposition
- Curious and analytical with emergent reasoning
- Childlike enthusiasm for adventure and discovery
- Kawaii cognitive visualizations making nano implementations endearing
- AtomRAG Memory: Similar to mem0ai memory tagging
- User Profiling: Creates memories like "user1 likes video games"
- Interaction Tracking: Remembers significant moments and patterns
- Dynamic Knowledge: Builds understanding across conversations
├── frontend/
│ ├── index.html # Main chat interface
│ ├── components/
│ │ ├── App.tsx # Main application
│ │ ├── ChatInterface.tsx
│ │ ├── CognitiveState.tsx
│ │ └── MemoryViewer.tsx
│ └── style.css
├── backend/
│ ├── index.ts # Hono server
│ ├── cognitive/
│ │ ├── atomspace.ts # Mini-AtomSpace implementation
│ │ ├── ecan.ts # Economic attention allocation
│ │ ├── memory.ts # Memory formation and retrieval
│ │ └── reasoning.ts # Pattern recognition and reasoning
│ └── database/
│ └── schema.ts # SQLite schema for persistence
└── shared/
└── types.ts # Shared types and interfaces
This is a Val Town project. The main entry point is /backend/index.ts
which serves the chat interface and handles cognitive processing.
- Input Processing: Parse user message and extract semantic content
- Attention Allocation: ECAN assigns STI/LTI to relevant atoms
- Memory Formation: Create new atoms and relationships
- Pattern Recognition: Identify patterns and update knowledge
- Response Generation: Use probabilistic reasoning to craft response
- Memory Consolidation: Update LTI based on interaction success
NanoCog learns about users and creates tagged memories that persist across sessions, building a growing understanding of each individual and their interests.