Spaces:
Sleeping
Sleeping
Upload README.md with huggingface_hub
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626712345678910111213141516171819202122232425262728293031# OpenMark
**Your personal knowledge graph β built from everything you've ever saved.**
OpenMark ingests your bookmarks, LinkedIn saved posts, and YouTube videos into a dual-store knowledge system: **ChromaDB** for semantic vector search and **Neo4j** for graph-based connection discovery. A LangGraph agent sits on top, letting you query everything in natural language.
Built by [Ahmad Othman Ammar Adi](https://github.com/OthmanAdi).
---
## What it does
- Pulls all your saved content from multiple sources into one place- Embeds everything using [pplx-embed](https://huggingface.co/collections/perplexity-ai/pplx-embed) (local, free) or Azure AI Foundry (fast, cheap)- Stores vectors in **ChromaDB** β find things by *meaning*, not keywords- Builds a **Neo4j knowledge graph** β discover how topics connect- Runs a **LangGraph agent** (powered by gpt-4o-mini) that searches both stores intelligently- Serves a **Gradio UI** with Chat, Search, and Stats tabs- Also works as a **CLI** β `python scripts/search.py "RAG tools"`
---
## Data Sources
### 1. Raindrop.io
Create a test token at [app.raindrop.io/settings/integrations](https://app.raindrop.io/settings/integrations).OpenMark pulls **all collections** automatically via the Raindrop REST API.
### 2. Browser Bookmarks
Export your bookmarks as an HTML file from Edge, Chrome, or Firefox:- **Edge:** `Settings β Favourites β Β·Β·Β· β Export favourites` β save as `favorites.html`- **Chrome/Firefox:** `Bookmarks Manager β Export`
Point `RAINDROP_MISSION_DIR` in your `.env` to the folder containing the exported HTML files.The pipeline parses the Netscape bookmark format automatically.
### 3. LinkedIn Saved Posts
LinkedIn does not provide a public API for saved posts. The included `linkedin_fetch.py` script uses your browser session cookie to call LinkedIn's internal Voyager GraphQL API.
**Steps:**1. Log into LinkedIn in your browser2. Open DevTools β Application β Cookies β copy the value of `li_at`3. Run: ```bash python raindrop-mission/linkedin_fetch.py ``` Paste your `li_at` cookie when prompted. The script fetches all saved posts and writes `linkedin_saved.json`.
> **Personal use only.** This uses LinkedIn's internal API which is not publicly documented or officially supported. Use responsibly.
### 4. YouTube
Uses the official [YouTube Data API v3](https://developers.google.com/youtube/v3) via OAuth 2.0.
**Steps:**1. Go to [Google Cloud Console](https://console.cloud.google.com/) β Create a project2. Enable the **YouTube Data API v3**3. Create OAuth 2.0 credentials β Download as `client_secret.json`4. Add your Google account as a test user (OAuth consent screen β Test users)5. Run: ```bash python raindrop-mission/youtube_fetch.py ``` A browser window opens for auth. After that, `youtube_MASTER.json` is written with liked videos, watch later, and playlists.
---
## How it works
```Your saved content β βΌ normalize.py β clean titles, dedupe by URL, fix categories β βΌ EmbeddingProvider β LOCAL: pplx-embed-context-v1-0.6b (documents) pplx-embed-v1-0.6b (queries) AZURE: text-embedding-ada-002 β ββββββββββββββββββββββββββββββββββββ βΌ βΌ ChromaDB Neo4j (vector store) (knowledge graph) find by meaning find by connection
"show me RAG tools" "what connects LangGraph to my Neo4j saves?" β β ββββββββββββββββ¬ββββββββββββββββββββ βΌ LangGraph Agent (gpt-4o-mini) β βΌ Gradio UI / CLI```
### Why embeddings?
An embedding is a list of numbers that represents the *meaning* of a piece of text. Two pieces of text with similar meaning will have similar numbers β even if they use completely different words. This is how OpenMark finds "retrieval augmented generation tutorials" when you search "RAG tools."
### Why ChromaDB?
ChromaDB stores those embedding vectors locally on your disk. It's a persistent vector database β no server, no cloud, no API key. When you search, it compares your query's embedding against all stored embeddings and returns the closest matches.
### Why Neo4j?
Embeddings answer "what's similar?" β Neo4j answers "how are these connected?" Every bookmark is a node. Tags, categories, domains, and sources are also nodes. Edges connect them. After ingestion, OpenMark also writes `SIMILAR_TO` edges derived from embedding neighbors β so the graph contains semantic connections you never manually created. You can then traverse: *"start from this LangChain article, walk similar-to 2 hops, what clusters emerge?"*
---
## Requirements
- Python 3.13- Neo4j Desktop (local) or AuraDB (cloud) β [neo4j.com/download](https://neo4j.com/download/)- **Either** Azure AI Foundry account **or** enough disk space for local pplx-embed (~1.2 GB)
---
## Setup
### 1. Clone and install
```bashgit clone https://github.com/OthmanAdi/OpenMark.gitcd OpenMarkpip install -r requirements.txt```
### 2. Configure
```bashcp .env.example .env```
Edit `.env` with your values:
```env# Choose your embedding providerEMBEDDING_PROVIDER=local # or: azure
# Azure AI Foundry (required if EMBEDDING_PROVIDER=azure, also used for the LLM agent)AZURE_ENDPOINT=https://your-resource.cognitiveservices.azure.com/AZURE_API_KEY=your-keyAZURE_DEPLOYMENT_LLM=gpt-4o-miniAZURE_DEPLOYMENT_EMBED=text-embedding-ada-002
# Neo4jNEO4J_URI=bolt://127.0.0.1:7687NEO4J_USER=neo4jNEO4J_PASSWORD=your-passwordNEO4J_DATABASE=neo4j
# Raindrop (get token at app.raindrop.io/settings/integrations)RAINDROP_TOKEN=your-token
# Path to your raindrop-mission data folderRAINDROP_MISSION_DIR=C:\path\to\raindrop-mission```
### 3. Ingest
```bash# Local embeddings (free, ~20 min for 8K items on CPU)python scripts/ingest.py
# Azure embeddings (fast, ~5 min, costs ~β¬0.30 for 8K items)python scripts/ingest.py --provider azure
# Also pull fresh from Raindrop API during ingestpython scripts/ingest.py --fresh-raindrop```
### 4. Search (CLI)
```bashpython scripts/search.py "RAG tools"python scripts/search.py "LangGraph" --category "Agent Development"python scripts/search.py --tag "rag"python scripts/search.py --stats```
### 5. Launch UI
```bashpython openmark/ui/app.py```
Open [http://localhost:7860](http://localhost:7860)
---
## Required API Keys
| Key | Where to get it | Required? ||-----|----------------|-----------|| `RAINDROP_TOKEN` | [app.raindrop.io/settings/integrations](https://app.raindrop.io/settings/integrations) | Yes || `AZURE_API_KEY` | Azure Portal β your AI Foundry resource | Only if `EMBEDDING_PROVIDER=azure` || `NEO4J_PASSWORD` | Set when creating your Neo4j database | Yes || YouTube OAuth | Google Cloud Console β YouTube Data API v3 | Only if ingesting YouTube |
No HuggingFace token is needed for local pplx-embed. The models are open weights and download automatically. You will see a warning `"You are sending unauthenticated requests to the HF Hub"` β this is harmless and can be silenced by setting `HF_TOKEN` in your `.env` if you want higher rate limits.
---
## Project Structure
```OpenMark/βββ openmark/β βββ config.py β all settings loaded from .envβ βββ pipeline/β β βββ raindrop.py β pull all Raindrop collections via APIβ β βββ normalize.py β clean, dedupe, build embedding textβ β βββ merge.py β combine all sourcesβ βββ embeddings/β β βββ base.py β abstract EmbeddingProvider interfaceβ β βββ local.py β pplx-embed (local, free)β β βββ azure.py β Azure AI Foundryβ β βββ factory.py β returns provider based on .envβ βββ stores/β β βββ chroma.py β ChromaDB: ingest + semantic searchβ β βββ neo4j_store.py β Neo4j: graph nodes, edges, traversalβ βββ agent/β β βββ tools.py β LangGraph tools (search, tag, graph)β β βββ graph.py β create_react_agent with gpt-4o-miniβ βββ ui/β βββ app.py β Gradio UI (Chat / Search / Stats)βββ scripts/ βββ ingest.py β full pipeline runner βββ search.py β CLI search```
---
## Roadmap
- [ ] OpenAI embeddings integration- [ ] Ollama local LLM support- [ ] Pinecone vector store option- [ ] Web scraping β fetch full page content for richer embeddings- [ ] Browser extension for real-time saving to OpenMark- [ ] Comet / Arc browser bookmark import- [ ] Automatic re-ingestion on schedule- [ ] Export to Obsidian / Notion- [ ] Multi-user support
---
## Documentation
| Doc | What's in it ||-----|-------------|| [docs/data-collection.md](docs/data-collection.md) | Full guide for each data source β Raindrop, Edge, LinkedIn cookie method, YouTube OAuth, daily.dev console script || [docs/ingest.md](docs/ingest.md) | All ingest flags, timing for each step, how SIMILAR_TO edges work, re-run behavior || [docs/architecture.md](docs/architecture.md) | Dual-store design, Neo4j graph schema, embedding patches, Cypher query examples, agent tools || [docs/troubleshooting.md](docs/troubleshooting.md) | pplx-embed compatibility fixes, LinkedIn queryId changes, Neo4j connection issues, Windows encoding |
---
## License
MIT---
title: OpenMark
emoji: π
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "6.6.0"
app_file: app.py
pinned: true
license: mit
short_description: Personal knowledge graph β search 8K+ bookmarks with AI
tags:
- rag
- knowledge-graph
- neo4j
- chromadb
- langraph
- pplx-embed
- second-brain
- bookmarks
---
# OpenMark
**Personal knowledge graph** β 8,000+ bookmarks, LinkedIn saves, and YouTube videos indexed with pplx-embed, searchable with ChromaDB and Neo4j, queryable via a LangGraph agent.
Built by [Ahmad Othman Ammar Adi](https://github.com/OthmanAdi) Β· [GitHub](https://github.com/OthmanAdi/OpenMark)
## Setup required
This Space requires your own credentials (Neo4j, Azure, Raindrop). See the [GitHub repo](https://github.com/OthmanAdi/OpenMark) for full setup instructions.README.md+31-267