An open API service indexing awesome lists of open source software.

https://github.com/rohitprasad-code/digital.me

An AI agent mirroring my life and work by syncing Strava, LinkedIn, and personal data into a conversational twin.
https://github.com/rohitprasad-code/digital.me

digital-twin nextjs ollama strava-api

Last synced: 4 months ago
JSON representation

An AI agent mirroring my life and work by syncing Strava, LinkedIn, and personal data into a conversational twin.

Awesome Lists containing this project

README

          

# Digital Me

Digital Me is an AI-powered personal digital twin. It's designed to ingest your personal data (resume, GitHub activity, etc.) and use a local LLM (via Ollama) to answer questions as if it were you.

## Features

| Category | Details |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **RAG Pipeline** | Retrieval-Augmented Generation grounded in your personal data for accurate, contextual answers |
| **Smart Memory Router** | Keyword & LLM-based query classification across Static, Dynamic, and Conversational memory types |
| **Structure-Aware Ingestion** | Two-stage document pipeline โ€” parses PDFs & text into structured sections, then chunks with configurable overlap |
| **Multi-Source Data** | Resume (PDF), `me.json` identity config, GitHub (profile + repos + commits), Strava (activities) |
| **CLI Interface** | `chat` and `ingest` commands powered by [Commander](https://github.com/tj/commander.js) |
| **Next.js API** | RESTful chat endpoint with full RAG orchestration |
| **100% Local** | Powered by Ollama (Llama 3) โ€” your data never leaves your machine |

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ CLI Chat โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ Next.js API โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ Ollama (LLM) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ โ–ฒ
โ–ผ โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Memory Routerโ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ Vector Storeโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ โ–ฒ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ–ผ โ–ผ โ–ผ โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ Static โ”‚ โ”‚ Dynamic โ”‚ โ”‚ Conversa-โ”‚ โ”‚
โ”‚ Memory โ”‚ โ”‚ Memory โ”‚ โ”‚ tional โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚ โ”‚
โ–ผ โ–ผ โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚Resume/PDFโ”‚ โ”‚ GitHub โ”‚ โ”‚
โ”‚ me.json โ”‚ โ”‚ Strava โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

## ๐Ÿ“ Project Structure

```
digital-me/
โ”œโ”€โ”€ app/
โ”‚ โ””โ”€โ”€ api/ # Next.js API route โ€” chat endpoint + RAG logic
โ”œโ”€โ”€ cli/
โ”‚ โ”œโ”€โ”€ index.ts # CLI entrypoint (Commander)
โ”‚ โ””โ”€โ”€ chat.ts # Interactive chat session
โ”œโ”€โ”€ integrations/
โ”‚ โ”œโ”€โ”€ github/ # GitHub profile, repos & commit ingestion
โ”‚ โ””โ”€โ”€ strava/ # Strava activity ingestion
โ”œโ”€โ”€ memory/
โ”‚ โ”œโ”€โ”€ ingest.ts # Orchestrates full ingestion pipeline
โ”‚ โ”œโ”€โ”€ router.ts # MemoryRouter โ€” routes queries by type
โ”‚ โ”œโ”€โ”€ vector_store/ # Embedding storage & cosine similarity search
โ”‚ โ””โ”€โ”€ data_processing/ # Document parsing, structure analysis & chunking
โ”‚ โ””โ”€โ”€ parsers/ # Parsers for PDF, Markdown, JSON and all
โ”œโ”€โ”€ model/
โ”‚ โ”œโ”€โ”€ llm/ # Ollama client configuration
โ”‚ โ””โ”€โ”€ prompts/ # System prompts & prompt templates
โ”œโ”€โ”€ public/ # Raw static data sources
โ”‚ โ”œโ”€โ”€ codes/ # Structured config (e.g., me.json)
โ”‚ โ””โ”€โ”€ documents/ # PDFs, Markdown, Text (e.g., resume.pdf)
โ””โ”€โ”€ scripts/
โ””โ”€โ”€ dev-cli.js # Dev helper for CLI execution
```

## ๐Ÿ“‹ Prerequisites

- **Node.js** v18+
- **Ollama** installed and running โ€” pull a model:
```bash
ollama pull llama3
```
- **GitHub Token** โ€” [Personal Access Token](https://github.com/settings/tokens) with `repo` and `read:user` scopes
- **Strava Token** โ€” API token with `read`, `activity:read`, `activity:write`, `activity:read_all` scopes

## ๐Ÿš€ Getting Started

### 1. Clone & Install

```bash
git clone https://github.com/yourusername/digital-me.git
cd digital-me
npm install
```

### 2. Configure Environment

Create a `.env.local` file in the project root:

```env
# GitHub integration
GITHUB_TOKEN=your_github_token
GITHUB_USERNAME=your_github_username

# Strava integration
STRAVA_ACCESS_TOKEN=your_strava_token

# Optional: Override API URL
# e.g.:
# DIGITAL_ME_API_URL=http://localhost:7001/api
```

### 3. Prepare Your Data

| File | Purpose |
| -------------------------- | ----------------------------------------------------- |
| `memory/static/resume.pdf` | Your resume (parsed via LLM into structured sections) |

### 4. Run

```bash
# Terminal 1 โ€” Start the API server
npm run dev

# Terminal 2 โ€” Ingest your data into the vector store
npm run cli ingest

# Terminal 3 โ€” Run the scheduler
npm run scheduler

# Terminal 4 โ€” Start chatting with your digital twin
npm run cli chat
```

## ๐Ÿงฐ Available Scripts

| Script | Description |
| -------------------- | --------------------------------------------- |
| `npm run dev` | Start the Next.js dev server |
| `npm run build` | Production build |
| `npm run start` | Start production server |
| `npm run cli ingest` | Ingest all data sources into the vector store |
| `npm run cli sync` | Sync latest changes into vector store |
| `npm run cli chat` | Launch the interactive chat CLI |
| `npm run test` | Run tests with Vitest |
| `npm run lint` | Lint with ESLint |
| `npm run scheduler` | Run the scheduler |

## ๐Ÿ”ฎ Roadmap

- [ ] **More Integrations** โ€” LinkedIn, Instagram, Google Fit
- [ ] **Dynamic Modes** โ€” Intent-based persona switching (Recruiter vs. Friend mode)
- [ ] **Rich Responses** โ€” Serve visual UI components (GitHub stats, heatmaps, activity charts)
- [ ] **Hardware Integration** โ€” ESP32 sensors for live status, room presence & ambient interaction
- [ ] **Voice Interface** โ€” Conversational voice input/output
- [ ] **On-Device Inference** โ€” Run smaller models directly on edge hardware
- [ ] **Agent Scheduling** โ€” Automated periodic data refresh & proactive notifications