A personal RAG-powered investment thesis journal with local LLM integration.
- Chat with your Notes - Query historical investment theses using semantic search
- Log New Thesis - Record asset/ticker, market stance (Bullish/Neutral/Bearish), and reasoning
- Accountability - Each entry requires an author name
- Recent Intelligence - Preview your 6 most recent entries
- Incremental RAG - New entries are indexed instantly without full rebuild
- Local LLM - Private AI analysis via Ollama (llama3.2)
- Persistent Storage - Markdown files + ChromaDB vector database
# 1. Install dependencies
pip install -r requirements.txt
# 2. Install & start Ollama (required for chat)
# Download from: https://ollama.ai
ollama pull llama3.2
ollama pull nomic-embed-text
ollama serve
# 3. Run AlphaNote
python app.pyIf port 7860 is occupied, either:
ALPHANOTE_PORT=7861 python app.pyor stop old process first:
lsof -nP -iTCP:7860 -sTCP:LISTEN
kill <PID>personal-RAG/
├── app.py # Main application
├── requirements.txt # Python dependencies
├── knowledge-base/ # Markdown storage
│ └── entries_001.md # Investment thesis journal
└── vector_db/ # ChromaDB (auto-generated)
Entries are stored in knowledge-base/entries_XXX.md:
---
## GOLD | Bullish | 2026-01-31 14:30 | Oliver
Gold remains attractive as a hedge against uncertainty...When a file exceeds 500KB, a new file (entries_002.md, etc.) is created automatically.
Edit app.py constants:
| Variable | Default | Description |
|---|---|---|
MAX_FILE_SIZE_KB |
500 | File size limit before rotation |
USE_LOCAL_LLM |
True | Use Ollama (True) or OpenAI (False) |
LOCAL_MODEL |
llama3.2 | Ollama model name |
OPENAI_MODEL |
gpt-4o-mini | OpenAI model (if USE_LOCAL_LLM=False) |
EMBEDDING_MODEL |
nomic-embed-text | Ollama embedding model |
- Port conflict: older AlphaNote processes were still listening on
7860, so Gradio failed with:Cannot find empty port in range.... - Environment drift with latest dependency versions: eager imports in the original startup path (
langchain_huggingface,langchain_openai, and heavy splitters/loaders) could block startup in this local Python/venv setup.
- Made launch port configurable via
ALPHANOTE_PORT; if not set, app uses Gradio default behavior. - Reduced startup-time heavy imports:
- switched embeddings to
OllamaEmbeddings(nomic-embed-text) - replaced LangChain
ChatOpenAIcall path with direct Ollama HTTP call - replaced heavy text-splitter/doc-loader path with lightweight local chunking
- switched embeddings to
- Deferred vector DB initialization until first request, so UI can start quickly and reliably.
- Incremental Updates: New entries are added to vector DB without rebuilding
- Persistent Embeddings: Model loaded once at startup
- Disk-based VectorDB: ChromaDB persists between restarts
- Python 3.10+
- Ollama running locally (
ollama serve) - ~2GB disk space for llama3.2 model