tpt-eve

Rust

TPT Eve is a Rust cognitive architecture that augments LLM pattern recognition with symbolic reasoning, causal inference, abstraction, active learning, and meta-cognition. It runs fully locally (tpt-spark or Ollama) or against cloud APIs (Anthropic, OpenAI, OpenRouter) with no external services required for the default mock demo.

0 stars0 forks0 watchers
active-learningcausal-inferencecognitive-architectureknowledge-graphllmlocal-llmneuro-symbolicollamarustsymbolic-reasoning

Languages

Rust100.0%
README

TPT Eve

TPT Eve is a cognitive architecture that moves beyond statistical pattern matching to build systems capable of genuine understanding, causal reasoning, and discovery. LLMs are excellent at recognising patterns in data, but on their own they don't understand why things happen, can't reliably extract abstract principles, and can't discover genuinely new insights.

TPT Eve doesn't replace the statistical engine — it augments it. LLMs handle language understanding and pattern recognition; on top of that, TPT Eve layers symbolic reasoning, causal inference, cross-domain abstraction, active experimentation, and meta-cognition.

See spec.txt for the full design document and todo.md for the project's current build status.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      TPT EVE ARCHITECTURE                    │
├─────────────────────────────────────────────────────────────┤
│  META-COGNITIVE LAYER        — confidence, knowledge gaps    │   Phase 5
│  ACTIVE LEARNING LOOP        — hypotheses, experiments       │   Phase 4
│  ABSTRACTION ENGINE          — cross-domain principles       │   Phase 3
│  CAUSAL REASONING ENGINE     — causal graphs, interventions  │   Phase 2
│  SYMBOLIC REASONING LAYER    — working memory, rule engine   │   Phase 1
│  NEURAL PATTERN LAYER (LLM)  — fact & relation extraction    │   Phase 1
└─────────────────────────────────────────────────────────────┘

All five phases are implemented. Each phase builds on the previous and is independently accessible via the eve CLI.

Quickstart

cargo build --workspace

# Phase 1 — extract facts, apply rules, answer questions (mock LLM, no key needed)
cargo run -p eve-cli -- demo --backend mock

# Phase 2 — causal reasoning: interventions, counterfactuals, effect estimation
cargo run -p eve-cli -- whatif --backend mock

# Phase 3 — abstraction: pattern mining, analogical mapping, knowledge transfer
cargo run -p eve-cli -- abstract

# Phase 4 — active learning: hypothesis generation, experiment, belief updating
cargo run -p eve-cli -- learn

# Phase 5 — meta-cognition: confidence tracking, gap detection, learning agenda
cargo run -p eve-cli -- reflect

Other backends for demo, extract, and whatif:

FlagBackendRequires
--backend mockDeterministic fixture (default)Nothing
--backend sparktpt-spark headless JSON-RPCtpt-spark running
--backend ollamaOllama HTTP APIOllama + a model
--backend anthropicAnthropic Messages APIANTHROPIC_API_KEY
--backend openaiOpenAI Chat CompletionsOPENAI_API_KEY
--backend openrouterOpenRouter (OpenAI-compatible)OPENROUTER_API_KEY

Environment variables

VariablePurpose
OLLAMA_HOSTOllama base URL (default: http://localhost:11434)
ANTHROPIC_API_KEYAnthropic API key
OPENAI_API_KEYOpenAI API key
OPENROUTER_API_KEYOpenRouter API key

CLI Reference

eve extract <text> [--backend <b>] [--model <id>] [--format text|json] [--save <file>]
                                     Extract facts; optionally save session to redb file
eve ask "<question>" [--load <file>] Query the symbolic layer (load session or demo KB)
eve explain "<question>" [--load <file>]
                                     Answer with full inference provenance chain
eve demo [--backend <b>] [--model <id>]
                                     Phase 1 end-to-end: extract → infer → ask
eve whatif [--backend <b>] [--model <id>] [--graph]
                                     Phase 2 causal: intervention + counterfactual
                                     --graph emits DOT digraph on stdout
eve abstract [--backend <b>]         Phase 3 abstraction demo
eve learn                            Phase 4 active learning demo
eve reflect                          Phase 5 meta-cognition demo
eve repl                             Interactive REPL: type facts/rules/queries line by line
eve serve [--backend <b>] [--port <n>]
                                     HTTP REST API on port 3737 (default)
                                     POST /extract  {"text":"..."}  → [facts]
                                     POST /ask      {"question":"..."} → {"answer":...}
                                     GET  /facts    → [all asserted facts]

Workspace Layout

CratePhasePurpose
eve-coreShared types: Fact, Pattern, Value, EveError
eve-dslRule/query DSL: lexer, parser, AST
eve-symbolic1Working memory, forward-chaining inference, consistency checking
eve-neural1NeuralPatternLayer trait + tpt-spark/Ollama/cloud/mock backends
eve-causal2Causal DAG construction, SCM, intervention calculus, counterfactuals
eve-abstraction3Pattern mining, analogical reasoning, knowledge transfer
eve-active-learning4Hypothesis generation, experiment design, Bayesian belief updating
eve-metacognition5Confidence tracking, knowledge-gap detection, learning prioritisation
eve-cliThe eve binary
eve-testsWorkspace integration and acceptance tests

See CLAUDE.md for build commands and architectural detail.

License

Apache-2.0 — see LICENSE.