AI Compound Interest Knowledge Management - Bank your thoughts, compound your intelligence
Project description
๐ฆ ThinkBank
AI Compound Interest Knowledge Management
Bank your thoughts, compound your intelligence. ๅญๅจๆๆณ๏ผๅคๅฉๆบๆ งใ
โ ๏ธ ALPHA RELEASE - UNDER ACTIVE DEVELOPMENT
ThinkBank is in early alpha stage. Expect bugs and breaking changes. Not recommended for production use yet.
โญ Star the repo to follow progress!
What is ThinkBank?
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.
The Problem
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
The Solution: AI Compound Interest
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
Key Features
๐ง Intelligent Worthiness Filtering
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.92
๐ 5-Factor Value Assessment
Each 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
๐๏ธ 6 Knowledge Types
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
๐ฆ Import/Export Knowledge Packs
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-run
Knowledge Pack Format (.khb):
- Compressed JSON/YAML bundle
- Includes metadata (author, version, creation date)
- Conflict resolution strategies (skip/overwrite/merge/rename)
- Portable across systems
๐ On-Demand Web UI (Optional)
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 stop
CLI-only users: The server will still run without Web UI dependencies, providing API-only access.
Installation
Standalone Installation
# 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: Install Web UI dependencies
pip install fastapi uvicorn jinja2 python-multipart
Note: Web UI dependencies are optional. All core functionality (CLI, Python API) works without them.
Install with Squad Integration
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
Development Installation
# 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/
Quick Start
1. Basic Usage (Python API)
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}")
2. CLI Usage
# 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 stop
3. Integration with Claude Code
Add 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.
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
Philosophy: AI Compound Interest
Traditional AI Conversations
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
With ThinkBank
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
The Compound Effect
| 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 |
Configuration
Default Paths
~/.squad/
โโโ knowledge/ # Knowledge base directory
โ โโโ skills/
โ โโโ rules/
โ โโโ patterns/
โ โโโ domain/
โ โโโ user/
โ โโโ lessons/
โโโ knowledge_hub.pid # Web UI process ID
โโโ config.yaml # Configuration (optional)
Custom Configuration
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
Documentation
- 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
Comparison: ThinkBank vs. Alternatives
| Feature | ThinkBank | RAG Systems | Vector DBs | Note-Taking |
|---|---|---|---|---|
| AI Self-Aware Filtering | โ | โ | โ | โ |
| Token Efficiency | โ High | โ ๏ธ Medium | โ ๏ธ Medium | โ Low |
| Worthiness Evaluation | โ Automatic | โ Manual | โ None | โ Manual |
| Structured Taxonomy | โ 20 categories | โ ๏ธ Generic | โ Flat | โ ๏ธ Tags only |
| CQI Metrics | โ Built-in | โ | โ | โ |
| Import/Export | โ .khb format | โ ๏ธ Varies | โ ๏ธ Varies | โ |
| Resource Usage | โ Minimal | โ ๏ธ Heavy | โ ๏ธ Heavy | โ Minimal |
Key Differentiator: ThinkBank is purpose-built for AI assistants, not adapted from general-purpose systems.
Roadmap
Phase A (Complete) โ
- โ 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
Phase B (Planned)
- โณ Vector search for semantic similarity
- โณ Knowledge evolution tracking (version history)
- โณ Collaborative filtering (multi-user scenarios)
- โณ Integration with external knowledge bases
Phase C (Future)
- ๐ Machine learning for worthiness prediction
- ๐ Automatic knowledge synthesis (combine related items)
- ๐ Proactive knowledge suggestions
- ๐ Cross-project knowledge sharing
See ROADMAP.md for details.
Contributing
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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by: The concept of compound interest in finance
- Built for: Claude Code and AI assistant ecosystems
- Philosophy: "Make every conversation count"
Contact & Support
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thinkbank-0.1.0a1.tar.gz.
File metadata
- Download URL: thinkbank-0.1.0a1.tar.gz
- Upload date:
- Size: 56.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c6e8fd04684c9e7df2303594c11d1f93b700a9d065652906abf9b86acad92a3
|
|
| MD5 |
746e08e19e6e192b417b131874382a88
|
|
| BLAKE2b-256 |
f0c85d5c3915183c93b20cc01cfa2d460055fca5d23eb99b76d5ccd36914a0b3
|
File details
Details for the file thinkbank-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: thinkbank-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 48.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97bb19fbc0aa4301293dbeeca5fa457178d7c1c8c0e11e3a97da7d9bf3713af
|
|
| MD5 |
c83f8981de55fa892763c20520768f5b
|
|
| BLAKE2b-256 |
6de5e3a4725ec5fe47044f0fc03f0f34d15d5080d5e3cd8fbc6b3e4f01e7770b
|