Expand description
§ThoughtChain - Autonomous Thought Tracking and Knowledge Management
ThoughtChain provides persistent thought and decision tracking for AI systems, along with conversation search and dynamic knowledge base management through engrams.
§Features
§🧠 Autonomous Reasoning
Track internal reasoning, decisions, and observations across sessions:
- Thoughtchain: Persistent thought and decision log
- Session tracking: Organize thoughts by session
- Semantic search: Find similar thoughts using embeddings
- Opcode storage: Optional binary decision encoding
§🔍 Conversation Search
Temporal-aware conversation history retrieval:
- Temporal queries: “What did I first ask?”, “What did we discuss earlier?”
- Keyword detection: Automatic conversation vs knowledge query classification
- FTS5 search: Fast full-text search over conversation history
§📚 Dynamic Knowledge Base (Engrams)
Hot-reloadable knowledge archives:
- Auto-loading: Watch directory and load new engrams automatically
- Multi-engram search: Query across all loaded knowledge bases
- CML format: Structured content with embeddings
§Usage
use frame_thoughtchain::{ThoughtChainStore, ThoughtType, EngramRegistry};
use uuid::Uuid;
use frame_catalog::database::Database;
// Create thought tracking
let db = Database::new("thoughts.db").unwrap();
let store = ThoughtChainStore::new(&db);
store.initialize_schema().unwrap();
// Create a session
let session_id = Uuid::new_v4();
store.create_session(session_id, None, Some("my-project"), Some("main"), None).unwrap();
// Load knowledge base engrams
let registry = EngramRegistry::new("engrams/", true).unwrap();
println!("Loaded {} engrams with {} total chunks",
registry.list_engrams().len(),
registry.total_chunks()
);Re-exports§
pub use thoughtchain::ThoughtChainStore;pub use thoughtchain::ThoughtEntry;pub use thoughtchain::ThoughtType;pub use thoughtchain::PurgeItem;pub use thoughtchain::PurgeMatchType;pub use thoughtchain::PurgeRecommendations;pub use thoughtchain::PurgeResult;pub use conversation_search::is_conversation_query;pub use conversation_search::detect_temporal_context;pub use conversation_search::TemporalContext;pub use conversation_search::search_with_temporal_context;pub use conversation_search::get_first_user_message;pub use conversation_search::get_recent_messages;pub use conversation_search::format_conversation_context;pub use engram_registry::EngramRegistry;pub use engram_registry::LoadedEngram;pub use engram_registry::EngramSearchResult;pub use engram_registry::EngramRegistryError;
Modules§
- conversation_
search - Conversation memory search utilities
- engram_
registry - Dynamic Engram Registry
- thoughtchain
- Thoughtchain - Persistent thought and decision tracking