π§ Jonas
Local-first AI assistant with a neural policy brain.
Jonas is not just a chatbot wrapper around an LLM.
He separates:
π£ Language Model β speaks
π§ Neural Policy Brain β decides how he speaks
π Semantic Memory (SQLite + embeddings) β remembers context
π Online Feedback Loop β learns from your ratings
Fully local. No cloud APIs. Runs clean on Apple Silicon.
π₯ Philosophy
Most AI assistants are just prompt wrappers.
Jonas is different.
Instead of letting the LLM decide everything, Jonas uses a small PyTorch neural network to:
Adjust temperature dynamically
Control verbosity
Inject subtle humor
Decide how much memory to recall
Learn from /rate feedback
The LLM generates language.
The policy brain shapes behavior.
π Architecture User Input β Embedding (local via Ollama) β Neural Policy Brain (PyTorch MLP) β Memory Recall (SQLite + cosine similarity) β LLM (Ollama) β Response β Optional /rate feedback β trains policy π Personality
Jonas carries:
Tactical calm operator energy
Intelligent older-brother warmth
Quiet strategic executive clarity
Subtle, controlled wit
Grounded. Culturally fluent. Never theatrical. Never dismissive.
βοΈ Setup (Mac / Apple Silicon Recommended) 1οΈβ£ Install Ollama brew install ollama ollama serve 2οΈβ£ Pull models
Recommended:
ollama pull llama3.1:8b ollama pull nomic-embed-text
(You can use llama3.2:1b for lightweight testing.)
3οΈβ£ Python Setup python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt 4οΈβ£ Run Jonas python -m src.main π¬ Commands Command Description /quit Exit /reset Clear memory /history Show recent turns /rate 0.8 Train Jonas on last response π§ Neural Policy Brain
The policy network:
Small PyTorch MLP
Learns from scalar reward (0β1)
Saves weights to data/policy.pt
Adapts tone and structure over time
No reinforcement learning frameworks. No heavy infrastructure. Just incremental behavioral shaping.
π Privacy
All inference is local via Ollama.
Memory stored in local SQLite database.
No external API calls.
No telemetry.
π Project Structure jonas/ β βββ src/ β βββ main.py β βββ policy_brain.py β βββ persona.py β βββ encoder.py β βββ memory.py β βββ ollama_client.py β βββ data/ β βββ chat.db β βββ policy.pt β βββ requirements.txt βββ README.md π Roadmap
Planned improvements:
Policy smoothing (reduce tone switching)
Working-memory summarization
Structured task mode
Optional lightweight GUI
Long-term preference tagging
Better reward shaping
π§© Why Jonas Exists
To experiment with:
Policy steering for LLMs
Local-first AI systems
Minimal RL-style feedback loops
Human-in-the-loop tone adaptation
Jonas is a research playground disguised as a personal assistant.
Smaller models (1B) may exaggerate tone.
8B models handle nuance significantly better.
Delete data/policy.pt if you change embedding size.
πͺΆ License
MIT