AI Compound Interest Knowledge Management
Bank your thoughts, compound your intelligence. 存储思想,复利智慧。
⚠️ ALPHA RELEASE - UNDER ACTIVE DEVELOPMENTThinkBank is in early alpha stage. Expect bugs and breaking changes. Not recommended for production use yet.
⭐ Star the repo to follow progress!
ThinkBank is your personal knowledge bank where every conversation deposits wisdom that compounds over time. Just like financial compound interest, every piece of knowledge you store amplifies the value of future interactions.
Instead of treating each conversation as isolated, ThinkBank captures, evaluates, and organizes insights so your AI assistant becomes smarter with every interaction. It's not just about storing information—it's about continuous improvement through intelligent filtering and categorization.
AI assistants like Claude are powerful but stateless. Every conversation starts from scratch:
- ❌ Repeat the same explanations multiple times
- ❌ No memory of past preferences or decisions
- ❌ Cannot learn from successful patterns
- ❌ Waste tokens on redundant context
ThinkBank implements a 5-factor knowledge value system with AI self-aware filtering:
- AI Self-Aware Worthiness Filtering - AI decides what knowledge is worth storing
- 10 AI Blind Spot Categories - Focus on gaps in AI's training data
- 10 AI Common Sense Categories - Capture domain-specific knowledge
- Conversation Quality Improvement (CQI) - Measurable impact on future conversations
- On-Demand Web UI - Review and manage knowledge visually
Not all information deserves storage. ThinkBank uses AI self-awareness to evaluate:
- ✅ Fills a genuine blind spot (not common knowledge)
- ✅ Reusable across conversations (not one-time facts)
- ✅ Improves future conversation quality (measurable CQI impact)
- ✅ Domain-specific insights (not generic advice)
- ✅ Concrete and actionable (not vague principles)
Example:
from thinkbank.core import WorthinessFilter
filter = WorthinessFilter()
decision, reasoning, confidence = filter.is_worth_storing(
content="User prefers British English spelling (colour, organise)",
conversation_context={
"type": "user_preference",
"domain": "writing_style"
}
)
# Output:
# decision: STORE
# reasoning: "This is a user-specific preference that should be remembered..."
# confidence: 0.92Each knowledge item is scored on 5 dimensions (0.0 - 1.0):
| Factor | Description | Example |
|---|---|---|
| Reusability | How often will this be useful? | User preferences: 0.95 |
| Specificity | How concrete and actionable? | Exact command syntax: 0.90 |
| AI Blind Spot | How much does this fill a gap? | Org-specific acronyms: 0.85 |
| Impact | Conversation quality improvement? | Error pattern fix: 0.80 |
| Decay | How long will this stay relevant? | Timeless principles: 0.95 |
Overall Score = Weighted average → Prioritize high-value knowledge
Organized by usage patterns:
- Skills - Step-by-step procedures
- Rules - Constraints and requirements
- Patterns - Recurring solutions
- Domain - Specialized terminology
- User - Personal preferences
- Lessons - Retrospective insights
Share knowledge across projects or teams:
# Export top-scoring items
thinkbank export my_knowledge.khb --min-score 0.7 --limit 50
# Import from shared pack
thinkbank import team_knowledge.khb --conflict merge
# Preview before importing
thinkbank import team_knowledge.khb --dry-runKnowledge Pack Format (.khb):
- Compressed JSON/YAML bundle
- Includes metadata (author, version, creation date)
- Conflict resolution strategies (skip/overwrite/merge/rename)
- Portable across systems
Note: Web UI is completely optional. All core functionality is available via CLI commands. If you prefer CLI-only workflows, you can skip the Web UI dependencies entirely.
Resource-efficient architecture:
- ✅ Starts only when needed (
thinkbank hub) - ✅ Auto-stops after 30 minutes idle
- ✅ FastAPI + modern web stack
- ✅ Browse, search, edit, and manage knowledge
- ✅ Visual dashboard with statistics
# Install Web UI dependencies (if not already installed)
pip install fastapi uvicorn jinja2 python-multipart
# Start web UI
thinkbank hub
# Access at http://localhost:8765
# UI opens automatically in browser
# Stop when done
thinkbank stopCLI-only users: The server will still run without Web UI dependencies, providing API-only access.
# Clone repository
git clone https://github.com/dwHou/ThinkBank.git
cd ThinkBank
# Install core dependencies
pip install -r requirements.txt
# Install package
pip install -e .
# Verify installation
thinkbank --help
# Optional: Enable shell tab completion (recommended)
./scripts/setup_completion.sh
# Optional: Install Web UI dependencies
pip install fastapi uvicorn jinja2 python-multipartNotes:
- Tab completion enables
thinkbank <TAB>to show available commands (like tensorboard/uvicorn). See Shell Completion Guide - Web UI dependencies are optional. All core functionality (CLI, Python API) works without them.
If you're using Squad framework:
cd /path/to/Squad
# Remove old plugin (if exists)
rm -rf ai-knowledge-plugin
# Add ThinkBank as submodule
git submodule add https://github.com/dwHou/ThinkBank thinkbank
git submodule update --init --recursive
# Install
cd thinkbank
./install.sh# Clone with development dependencies
git clone https://github.com/dwHou/ThinkBank.git
cd ThinkBank
# Install with dev extras
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black thinkbank/
isort thinkbank/from thinkbank.core import KnowledgeManager, WorthinessFilter
# Initialize
km = KnowledgeManager()
filter = WorthinessFilter()
# Check if knowledge is worth storing
content = "User prefers verbose error messages with full stack traces"
decision, reasoning, confidence = filter.is_worth_storing(content)
if decision == "STORE":
# Create knowledge item
knowledge_id = km.create(
knowledge_type="user",
title="Error Message Preference",
content=content,
factors={
"reusability": 0.9,
"specificity": 0.8,
"ai_blind_spot": 0.7,
"impact": 0.85,
"decay": 0.95
},
tags=["preferences", "debugging"]
)
print(f"✓ Stored as {knowledge_id}")
else:
print(f"✗ Not worth storing: {reasoning}")# List all knowledge items
thinkbank list
# List by type
thinkbank list --type user --min-score 0.8
# Search
thinkbank search "error handling"
# Export filtered knowledge
thinkbank export high_value.khb --min-score 0.8 --tags "debugging,testing"
# Import knowledge pack
thinkbank import high_value.khb
# Start web UI
thinkbank hub
# Check status
thinkbank status
# Stop web UI
thinkbank stopAdd to your Claude Code rules (~/.claude/rules/thinkbank.md):
# ThinkBank Knowledge Management
When users share valuable information:
1. Check worthiness with WorthinessFilter
2. If STORE decision, create knowledge item
3. Categorize by type (skill/rule/pattern/domain/user/lesson)
4. Add relevant tags for searchability
Always prioritize high-reusability, high-impact knowledge.┌─────────────────────────────────────────────────┐
│ User/Claude │
└────────────────────┬────────────────────────────┘
│
┌───────────┴───────────┐
│ │
┌────▼─────┐ ┌──────▼──────┐
│ CLI │ │ Python API │
└────┬─────┘ └──────┬──────┘
│ │
└───────────┬───────────┘
│
┌───────────▼───────────┐
│ Core Library │
├───────────────────────┤
│ - WorthinessFilter │
│ - ValueAssessor │
│ - KnowledgeManager │
│ - Taxonomy System │
│ - Import/Export │
└───────────┬───────────┘
│
┌───────────▼───────────┐
│ Storage Layer │
├───────────────────────┤
│ ~/.thinkbank/knowledge/ │
│ ├─ skills/ │
│ ├─ rules/ │
│ ├─ patterns/ │
│ ├─ domain/ │
│ ├─ user/ │
│ └─ lessons/ │
└───────────────────────┘
Optional Web UI:
┌───────────────────────┐
│ FastAPI Server │
├───────────────────────┤
│ - On-demand startup │
│ - Auto-timeout (30m) │
│ - RESTful API │
│ - Modern web UI │
└───────────────────────┘
Conversation 1: [Context] → [AI Response] → ❌ Forgotten
Conversation 2: [Same Context] → [AI Response] → ❌ Forgotten
Conversation 3: [Same Context] → [AI Response] → ❌ Forgotten
Result: Wasted tokens, repeated work, no learning
Conversation 1: [Context] → [AI Response] → ✓ Stored (if valuable)
Conversation 2: [Minimal Context] → [AI uses stored knowledge] → ✓ Updated
Conversation 3: [Minimal Context] → [AI uses refined knowledge] → ✓ Evolved
Result: Compounding efficiency, continuous improvement
| Metric | Without ThinkBank | With ThinkBank | Improvement |
|---|---|---|---|
| Repeat Context | 500 tokens/conv | 50 tokens/conv | 90% reduction |
| Conversation Quality | Baseline | +40% accuracy | Measurable CQI |
| Time to Resolution | 5 minutes | 2 minutes | 60% faster |
| Knowledge Retention | 0% (stateless) | 95% (persistent) | ∞ improvement |
~/.squad/
├── knowledge/ # Knowledge base directory
│ ├── skills/
│ ├── rules/
│ ├── patterns/
│ ├── domain/
│ ├── user/
│ └── lessons/
├── knowledge_hub.pid # Web UI process ID
└── config.yaml # Configuration (optional)
Create ~/.squad/config.yaml:
thinkbank:
# Storage settings
knowledge_base_path: ~/.thinkbank/knowledge
auto_backup: true
backup_interval: 86400 # seconds
# Worthiness filtering
min_confidence_threshold: 0.7
auto_store_high_confidence: true
# Value assessment weights
scoring_weights:
reusability: 0.25
specificity: 0.20
ai_blind_spot: 0.25
impact: 0.20
decay: 0.10
# Web UI
web_ui_port: 8765
auto_timeout_minutes: 30
open_browser_on_start: true
# Import/Export
default_export_format: json
compression_level: 6- Quick Start Guide - Get started in 5 minutes
- API Reference - Complete API documentation
- Philosophy & Design - Why ThinkBank exists
- Integration Guide - Use with Squad or standalone
- Contributing - How to contribute
- Changelog - Version history
| Feature | ThinkBank | RAG Systems | Vector DBs | Note-Taking |
|---|---|---|---|---|
| AI Self-Aware Filtering | ✅ | ❌ | ❌ | ❌ |
| Token Efficiency | ✅ High | ❌ Low | ||
| Worthiness Evaluation | ✅ Automatic | ❌ Manual | ❌ None | ❌ Manual |
| Structured Taxonomy | ✅ 20 categories | ❌ Flat | ||
| CQI Metrics | ✅ Built-in | ❌ | ❌ | ❌ |
| Import/Export | ✅ .khb format | ✅ | ||
| Resource Usage | ✅ Minimal | ✅ Minimal |
Key Differentiator: ThinkBank is purpose-built for AI assistants, not adapted from general-purpose systems.
- ✅ Core library (worthiness filter, value assessor, knowledge manager)
- ✅ AI blind spots & common sense taxonomies
- ✅ Import/Export knowledge packs (.khb format)
- ✅ On-demand web UI with auto-timeout
- ✅ CLI commands
- ⏳ Vector search for semantic similarity
- ⏳ Knowledge evolution tracking (version history)
- ⏳ Collaborative filtering (multi-user scenarios)
- ⏳ Integration with external knowledge bases
- 📅 Machine learning for worthiness prediction
- 📅 Automatic knowledge synthesis (combine related items)
- 📅 Proactive knowledge suggestions
- 📅 Cross-project knowledge sharing
See ROADMAP.md for details.
We welcome contributions! See CONTRIBUTING.md for guidelines.
Quick Links:
- Issues - Report bugs or request features
- Discussions - Ask questions or share ideas
- Pull Requests - Submit code changes
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by: The concept of compound interest in finance
- Built for: Claude Code and AI assistant ecosystems
- Philosophy: "Make every conversation count"
- GitHub Issues: Report a bug
- Discussions: Ask questions
- Email: (Add your contact email)
🏦 ThinkBank
Bank your thoughts, compound your intelligence
存储思想,复利智慧
Built with ❤️ for the AI community