Spaces:
Sleeping
Sleeping
Fix Space README configuration
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267# 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.ioCreate 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 BookmarksExport 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 PostsLinkedIn 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:```bashpython 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. YouTubeUses 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:```bashpython 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 LangGraphto 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 |---## LicenseMIT12345678910111213141516171819202122232425262728293031---title: OpenMarkemoji: πcolorFrom: bluecolorTo: purplesdk: gradiosdk_version: "6.6.0"app_file: app.pypinned: truelicense: mitshort_description: Personal knowledge graph β search 8K+ bookmarks with AItags:- 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 requiredThis 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