PHANTOM is a fully local AI assistant inspired by Tony Stark's J.A.R.V.I.S.
It supports voice and text interaction, maintains context-aware conversation, and persists memory across sessions using PostgreSQL with native pgvector.
✅ Run completely offline (local LLM + Postgres)
✅ Voice + text input (text ready; voice I/O planned)
✅ Memory that persists across restarts
✅ Semantic recall using Postgres vector search
✅ Web-based UI with WebSocket chat
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.5, Spring AI, Spring WebFlux |
| Database | PostgreSQL + pgvector extension |
| AI Model | Local Ollama (LLaMA3 / Mistral / other) |
| Embeddings | Ollama embeddings API |
| Frontend | WebSocket chat UI (React / plain HTML planned) |
✅ Java 21
✅ PostgreSQL 15+ with pgvector extension
✅ Ollama installed and running (ollama serve)
✅ Maven 3.9+
psql -U youruser -d phantomdb -c "CREATE EXTENSION IF NOT EXISTS vector;"
psql -U youruser -d phantomdb <<EOF
CREATE TABLE memory (
id SERIAL PRIMARY KEY,
key TEXT UNIQUE,
value TEXT,
embedding VECTOR(1536)
);
EOFUpdate application.yml with your Postgres connection info.
ollama serve
ollama pull llama3Optional: pull embedding model if using a dedicated one.
mvn spring-boot:runAccess your app at http://localhost:8080
- Send messages via WebSocket
/chat - Say
remember: <text>→ saves semantic memory - Say
recall: <query>→ retrieves related memories
- Add voice I/O endpoints (speech-to-text, text-to-speech)
- Build web-based chat UI
- Add configurable prompt templates
phantom/
├── src/main/java/com/gliesestudio/phantom/
│ ├── config/
│ ├── controller/
│ ├── service/
│ ├── model/
│ └── PhantomApplication.java
├── src/main/resources/
│ └── application.yml
├── pom.xml
└── README.md
Request
{
"text": "remember: I like Batman movies"
}Response
{
"reply": "Got it. I'll remember that."
}MIT — free to modify and use!