FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
zone
zoneNanoCog
Public
Like
NanoCog
Home
Code
4
backend
4
frontend
1
shared
1
README.md
Branches
1
Pull requests
Remixes
1
History
Environment variables
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

NanoCog 🧠✨

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.

Features

Cognitive Architecture

  • 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

Personality

  • 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

Memory & Learning

  • 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

Architecture

├── 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

Getting Started

This is a Val Town project. The main entry point is /backend/index.ts which serves the chat interface and handles cognitive processing.

Cognitive Process

  1. Input Processing: Parse user message and extract semantic content
  2. Attention Allocation: ECAN assigns STI/LTI to relevant atoms
  3. Memory Formation: Create new atoms and relationships
  4. Pattern Recognition: Identify patterns and update knowledge
  5. Response Generation: Use probabilistic reasoning to craft response
  6. 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.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.