Hi, have a look at this. Bored out of my mind, I ended up crafting my own JARVIS — after all, who wouldn’t want a personal AI butler?
It’s built with Python, LangChain, and Ollama, running a Qwen 7B model locally. No constant dependency on cloud services or big tech servers — just local AI power.
If the voice commands don’t impress you, maybe the web chat interface will.
It may look complex at first sight, but the architecture is fairly straightforward:
-
Feeding the Brain:
I gather a ton of text content (like fromdata.txt) and feed it into the system.
LangChain slices the text, and it goes into a Chroma vector database — think of it as digital flashcards for the AI. -
Answering Your Questions (RAG Magic):
When asked something, it looks inside the ChromaDB "flashcards" for relevant info, then passes the data to the Qwen 7B model for generating meaningful answers.
This process is known as Retrieval-Augmented Generation (RAG). -
Chat vs. Voice:
- Web UI: FastAPI powers the backend for typing in queries.
- Voice Mode: SpeechRecognition converts speech to text, and
pyttsx3replies back in voice.
Honestly, voice mode feels much cooler.
- 🎙 Voice Control – Talk to your computer like Tony Stark (without looking crazy).
- 💬 Web UI – Sleek chat interface when silence is preferred.
- 💻 Local AI – Runs entirely on your machine via Ollama.
- 🧠 Smart Retrieval – Uses RAG, so responses are grounded in real data, not hallucinations.
Before suiting up as an Avenger, make sure you’ve got these:
- Python – Version 3.8 or newer.
- Ollama – Installed and running.
Required models:qwen:7bnomic-embed-text
Pull them with:
ollama pull qwen:7b
ollama pull nomic-embed-text