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|
|
| 67 |
+
|
| 68 |
+
##
|
| 69 |
+
# Mycelium
|
| 70 |
+
|
| 71 |
+
**A local-first personal knowledge agent that captures, connects, and surfaces what matters β when it matters.**
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
|
| 75 |
+
π **[Live demo](https://huggingface.co/spaces/build-small-hackathon/mycelium)** Β· πΉ **[Demo video](https://www.youtube.com/watch?v=Kr7LxRm0JBs)** Β· π **[Field Notes](https://huggingface.co/blog/build-small-hackathon/mycelium)**
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## The Problem
|
| 80 |
+
|
| 81 |
+
Everyone saves things. Nobody revisits them. Screenshots, bookmarks, notes-to-self β all gone dark in a week. The capture habit exists. The recall loop doesn't.
|
| 82 |
+
|
| 83 |
+
Mycelium fixes the recall loop.
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## What It Does
|
| 88 |
+
|
| 89 |
+
- **Capture** β notes, links, images. Each processed by a local LLM into a structured summary with intent classification (`learn` / `act` / `reference` / `ephemeral`) and semantic tags.
|
| 90 |
+
- **ASK** β semantic search across your knowledge base with LLM synthesis, gap analysis, Feynman self-testing, and learning arc.
|
| 91 |
+
- **BRIEF** β daily digest with synthesis across captures and a weekly thread.
|
| 92 |
+
- **REVIEW** β spaced repetition (SM-2) targeting specific claims from your own notes.
|
| 93 |
+
- **GRAPH** β visual map of how your ideas connect via embedding similarity.
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## Quick Start
|
| 98 |
+
|
| 99 |
+
### Prerequisites
|
| 100 |
+
|
| 101 |
+
- Python 3.11+
|
| 102 |
+
- Node 18+
|
| 103 |
+
- [LM Studio](https://lmstudio.ai) β for local LLM inference
|
| 104 |
+
|
| 105 |
+
### 1. Clone and install
|
| 106 |
+
|
| 107 |
+
```bash
|
| 108 |
+
git clone https://github.com/ajit3259/Mycelium
|
| 109 |
+
cd Mycelium
|
| 110 |
+
python -m venv .venv
|
| 111 |
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
| 112 |
+
pip install -r requirements.txt
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
### 2. Set up LM Studio
|
| 116 |
+
|
| 117 |
+
1. Download [LM Studio](https://lmstudio.ai)
|
| 118 |
+
2. Load a **chat model** β recommended: `google/gemma-3-4b-it` or any instruction-tuned model under 8B
|
| 119 |
+
3. Load an **embedding model** β recommended: `BAAI/bge-base-en-v1.5` (search it in LM Studio's Discover tab, download the GGUF version)
|
| 120 |
+
4. Start the Local Server (default: `http://localhost:1234`)
|
| 121 |
+
|
| 122 |
+
### 3. Initialize the database
|
| 123 |
+
|
| 124 |
+
```bash
|
| 125 |
+
python -c "from db import init_db; init_db()"
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
Optionally seed with 22 example captures to explore the UI:
|
| 129 |
+
```bash
|
| 130 |
+
python seed.py
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
### 4. Start the backend
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
uvicorn main:app --port 8000
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
### 5. Build the frontend
|
| 140 |
+
|
| 141 |
+
```bash
|
| 142 |
+
cd frontend
|
| 143 |
+
npm install
|
| 144 |
+
npm run build # outputs to ../static/, served by FastAPI
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
Open [http://localhost:8000](http://localhost:8000).
|
| 148 |
+
|
| 149 |
+
> **Dev mode (hot reload):** `npm run dev` in the frontend folder β runs on port 5173 with proxy to backend.
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## Configuration
|
| 154 |
+
|
| 155 |
+
All config is in `config.py` and can be overridden with environment variables:
|
| 156 |
+
|
| 157 |
+
| Variable | Default | Description |
|
| 158 |
+
|---|---|---|
|
| 159 |
+
| `LM_STUDIO_URL` | `http://localhost:1234/v1` | LM Studio server URL |
|
| 160 |
+
| `LM_MODEL` | auto-detected | Chat model name (leave blank to use whatever is loaded) |
|
| 161 |
+
| `EMBED_MODEL` | `BAAI/bge-base-en-v1.5` | Sentence-transformer embedding model |
|
| 162 |
+
| `DB_PATH` | `./mind.db` | SQLite database path |
|
| 163 |
+
| `UPLOADS_DIR` | `./uploads` | Directory for uploaded images |
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
## How It Works
|
| 168 |
+
|
| 169 |
+
```
|
| 170 |
+
Capture β LLM enrichment β Embed β Connect β Surface β Review
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
1. You capture a note, URL, or image
|
| 174 |
+
2. LM Studio extracts summary, tags, intent, claims, and a recall question
|
| 175 |
+
3. `BAAI/bge-base-en-v1.5` embeds the summary into a 768-dim vector
|
| 176 |
+
4. Related captures link automatically via cosine similarity (rank-based, top 2)
|
| 177 |
+
5. Surface engine resurfaces captures by intent + recency scoring
|
| 178 |
+
6. SM-2 spaced repetition schedules review of what you should remember
|
| 179 |
+
|
| 180 |
+
---
|
| 181 |
+
|
| 182 |
+
## Project Structure
|
| 183 |
+
|
| 184 |
+
```
|
| 185 |
+
.
|
| 186 |
+
βββ main.py # FastAPI app β all API endpoints
|
| 187 |
+
βββ lm.py # Unified LLM interface (LM Studio + HF Transformers)
|
| 188 |
+
βββ db.py # SQLite schema + all queries
|
| 189 |
+
βββ surface.py # Intent-weighted surfacing + scoring
|
| 190 |
+
βββ config.py # Config β auto-detects HF Spaces vs local
|
| 191 |
+
βββ seed.py # Optional: seed 22 example captures
|
| 192 |
+
βββ requirements.txt
|
| 193 |
+
βββ FIELD_NOTES.md # Build post-mortem
|
| 194 |
+
βββ frontend/ # React + TypeScript + Vite + Tailwind CSS
|
| 195 |
+
β βββ src/
|
| 196 |
+
β βββ App.tsx
|
| 197 |
+
β βββ api.ts
|
| 198 |
+
β βββ types.ts
|
| 199 |
+
β βββ components/
|
| 200 |
+
β βββ CaptureBar.tsx # Note / Link / Image capture
|
| 201 |
+
β βββ Feed.tsx # Recent captures
|
| 202 |
+
β βββ AskScreen.tsx # Semantic search + synthesis
|
| 203 |
+
β βββ BriefScreen.tsx # Daily digest
|
| 204 |
+
β βββ ReviewScreen.tsx # Spaced repetition
|
| 205 |
+
β βββ GraphView.tsx # Knowledge graph
|
| 206 |
+
β βββ Card.tsx # Shared capture card
|
| 207 |
+
βββ static/ # Built frontend (served by FastAPI)
|
| 208 |
+
```
|
| 209 |
+
|
| 210 |
+
---
|
| 211 |
+
|