Frequently Asked Questions
Make sure you're running pip install -e . from the repo root (the directory containing pyproject.toml). The three packages live under */src/ and the build syste
Frequently Asked Questions
Installation & Setup
"No module named 'ravana_ml'" or "No module named 'ravana_grace'"
Make sure you're running pip install -e . from the repo root (the directory
containing pyproject.toml). The three packages live under */src/ and the
build system finds them automatically:
pip install -e .[full,dev]If you're running scripts directly (not through installed packages), the scripts
insert sys.path entries automatically. But if you're importing from Python
directly, you need the editable install.
"ModuleNotFoundError: No module named 'ravana.chat'"
The ravana package is installed from ravana/src/ravana/. If you see errors
about missing sub-packages, check:
- You installed from the repo root (
pip install -e .) - You're running Python from the repo root (for development path shims)
"Can't find data/corpora/teen_seeds.txt"
The seed corpus is gitignored. Generate it:
python scripts/gather_teen_seeds.pyThis creates data/corpora/teen_seeds.txt with ~296 teen-level English sentences.
"pip install -e . fails with setuptools error"
Ensure you have a recent setuptools (>=68):
pip install --upgrade setuptools wheel
pip install -e .[full,dev]Runtime
First run is very slow
This is expected. The first boot:
- Downloads GloVe embeddings (822 MB) if not cached
- Builds GloVe→64-D projection
- Trains the attribute encoder
- Seeds the concept graph from PMI statistics
Subsequent runs load from weights/ravana_weights.pkl and are much faster.
"The chatbot says 'I don't know' to everything"
That means the engine is working correctly — it's abstaining honestly rather than confabulating. Try:
- Running
python scripts/train.py --mode testfirst to seed with some knowledge - Asking more concrete questions like "what is trust" or "tell me about love"
- Checking if web learning is working (the engine searches the web when it has gaps)
Web search seems slow or times out
The engine has a 4-second socket timeout and a circuit breaker for failing search engines. This is intentional — it prevents a single bad search from blocking the user turn. If searches consistently fail:
- Check your internet connection
- The search engine uses DuckDuckGo HTML scraping (no API key needed)
- Set
--delayhigher if running background learning
"Windows access violation error" on startup
This is a known NumPy/OpenBLAS threading issue (numpy #27989). The engine auto-pins threads to 1, but some BLAS builds still encounter this. Try:
set OMP_NUM_THREADS=1
set OPENBLAS_NUM_THREADS=1
python scripts/ravana_chat.pyMemory usage seems high for a "small" system
The concept graph grows as the system learns. After a long session with web
learning, it can reach thousands of nodes and edges. Run --stats to see the
current size. Sleep consolidation prunes low-utility edges.
Development
How do I add a new benchmark?
- Create a new file in
experiments/(e.g.experiment_my_benchmark.py) - Import from
ravana.chat.engine,ravana_ml, orravana_graceas needed - Add a corresponding runner in
scripts/(e.g.scripts/my_benchmark.py) - Document it in BENCHMARKS.md
How do I extend the concept graph?
- Add new concepts:
graph.add_node(vector=vec, label="my_concept") - Add edges:
graph.add_edge(src_id, tgt_id, weight=0.7, relation_type="causal") - The engine auto-expands from user input via
_auto_expand_concepts()
How do I add a new brain-repair prepass?
Brain-repair prepasses live in ravana/src/ravana/chat/brain_regions.py. They run
BEFORE process_turn routing. Follow the existing pattern:
- Add your function to
brain_regions.py - Call it from
CognitiveChatEngine.process_turn()before the intent router - Make it fail-closed (return None/false when unsure)
- Add a test in
tests/unit/
How do I change the decoder?
The decoder (ravana_ml.nn.neural_decoder.NeuralDecoder) is a small GRU. To
change its architecture:
- Modify
ravana_ml/src/ravana_ml/nn/neural_decoder.py - The decoder uses
ravana_ml.nn.module(not PyTorch) — the module is self-contained - Run
python scripts/train.py --mode testto verify
Can I use PyTorch instead of the native tensor framework?
The native tensor framework (ravana_ml.tensor) is a lightweight numpy wrapper
designed to make the decoder API familiar (.forward(), .parameters(), etc.).
You can replace it with PyTorch if needed, but you'll lose the sleep-consolidation
loop that replaces optimizer.step().
Concepts
Why no backpropagation?
Backpropagation requires storing all intermediate activations for the chain rule. This is memory-intensive and GPU-dependent. RAVANA replaces it with:
- Pressure accumulation (localized prediction error)
- Hebbian updates (co-activation → strength change)
- Sleep consolidation (global reorganization)
Why a concept graph instead of a weight matrix?
The graph is sparse — only active edges are stored. A weight matrix is dense — every parameter is stored and updated. The graph also enables:
- Typed relations (causal, temporal, semantic, etc.)
- Discrete reasoning (chain walking, not matrix multiply)
- Inspectable knowledge (you can read every edge)
What is "sleep" in this context?
Sleep is a periodic consolidation phase that:
- Analyzes prediction errors across the graph
- Strengthens low-error edges, prunes noisy ones
- Resolves contradictory beliefs
- Integrates episodic patterns into semantic structure
- Runs counterfactual recombination (REM analog)
It replaces the gradient descent step in traditional ML.
What does "fail-closed" mean?
The system would rather say "I don't know" than emit confident nonsense. Every
gate (coherence, junk, salad, etc.) is designed so that if it malfunctions or
lacks data, it defaults to rejection rather than admission. This is
enforced throughout the codebase — see the design principles in docs/README.md.
Testing RAVANA
How the test suite is organized, how CI runs it, and the rules that keep the local and CI runs green. Every command and number below was exercised during the 20
Theoretical Foundations
RAVANA replaces the standard ML paradigm (loss functions → gradients → weight update) with a pressure-driven self-organization paradigm. This document explains