{"id":49512645,"url":"https://github.com/dilettacal/digital-twin","last_synced_at":"2026-05-01T20:33:24.125Z","repository":{"id":322882035,"uuid":"1091126371","full_name":"dilettacal/digital-twin","owner":"dilettacal","description":"My Digital Twin Companion","archived":false,"fork":false,"pushed_at":"2025-11-21T09:04:24.000Z","size":2936,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-21T10:22:28.969Z","etag":null,"topics":["ai-deployment","amazon","aws","chatbots","llms","openai","pythnon","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dilettacal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-06T15:37:21.000Z","updated_at":"2025-11-21T09:04:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dilettacal/digital-twin","commit_stats":null,"previous_names":["dilettacal/digital-twin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dilettacal/digital-twin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dilettacal%2Fdigital-twin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dilettacal%2Fdigital-twin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dilettacal%2Fdigital-twin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dilettacal%2Fdigital-twin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dilettacal","download_url":"https://codeload.github.com/dilettacal/digital-twin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dilettacal%2Fdigital-twin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-deployment","amazon","aws","chatbots","llms","openai","pythnon","reactjs","typescript"],"created_at":"2026-05-01T20:33:24.032Z","updated_at":"2026-05-01T20:33:24.099Z","avatar_url":"https://github.com/dilettacal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digital Twin AI\n\nAn AI-powered digital twin that mimics your communication style, knowledge, and personality. Built with FastAPI, Next.js, and AWS Bedrock.\n\n## What is this?\n\nThis application creates a conversational AI that represents you. It learns from your personal data (LinkedIn profile, facts about you, communication style) and responds to questions as if it were you. Think of it as your digital representative that can answer questions about your background, experience, and expertise.\n\n## How it works\n\nThe application consists of:\n- **Backend**: FastAPI server that uses AWS Bedrock (Nova models) to generate responses based on your personal data\n- **Frontend**: Next.js chat interface where users can interact with your digital twin\n- **Data Layer**: Your personal information (LinkedIn PDF, facts, style guide) that personalizes the AI\n\nWhen someone asks a question, the AI references your personal data to craft responses that sound like you and contain accurate information about you.\n\n## Architecture\n\nThe Digital Twin uses a modern architecture with multiple AI providers and flexible deployment options:\n\n```mermaid\ngraph LR\n    %% User Interface Layer\n    subgraph \"Frontend\"\n        UI[Chat Interface\u003cbr/\u003eNext.js]\n    end\n\n    %% Infrastructure Layer (Cloud or Local)\n    subgraph \"Infrastructure\"\n        subgraph \"Cloud (AWS)\"\n            CF[CloudFront CDN]\n            APIGW[API Gateway]\n            LAMBDA[AWS Lambda]\n        end\n\n        subgraph \"Local Dev\"\n            LOCAL[FastAPI Server\u003cbr/\u003elocalhost:8000]\n        end\n    end\n\n    %% Backend Application\n    subgraph \"FastAPI Backend\"\n        APP[Digital Twin API]\n        CHAT[Chat Endpoint]\n        %% RATE[Rate Limiter]\n    end\n\n    %% AI Services\n    subgraph \"AI Providers\"\n        BEDROCK[AWS Bedrock]\n        OPENAI[OpenAI]\n    end\n\n    %% Data Storage (Flexible)\n    subgraph \"Data Storage\"\n        subgraph \"Cloud Storage\"\n            S3D[S3 Personal Data]\n            S3M[S3 Memory]\n        end\n\n        subgraph \"Local Storage\"\n            FILES[Local Files\u003cbr/\u003ebackend/data/]\n            MEMORY[Local Memory\u003cbr/\u003e../history/]\n        end\n    end\n\n    %% External Services\n    subgraph \"External APIs\"\n        AIAPIS[AI Provider APIs]\n    end\n\n    %% Connections - Cloud Path\n    UI -.-\u003e|Cloud| CF\n    CF --\u003e APIGW\n    APIGW --\u003e LAMBDA\n    LAMBDA --\u003e APP\n\n    %% Connections - Local Path\n    UI -.-\u003e|Local| LOCAL\n    LOCAL --\u003e APP\n\n    %% Common Backend Flow\n    APP --\u003e CHAT\n    %% CHAT --\u003e RATE\n    CHAT --\u003e BEDROCK\n    CHAT --\u003e OPENAI\n    BEDROCK --\u003e AIAPIS\n    OPENAI --\u003e AIAPIS\n\n    %% Data Connections (Cloud)\n    CHAT -.-\u003e|Cloud| S3D\n    CHAT -.-\u003e|Cloud| S3M\n\n    %% Data Connections (Local)\n    CHAT -.-\u003e|Local| FILES\n    CHAT -.-\u003e|Local| MEMORY\n\n    %% Styling for dark backgrounds\n    classDef frontend fill:#00bcd4,stroke:#ffffff,stroke-width:2px,color:#ffffff\n    classDef aws fill:#ff6f00,stroke:#ffffff,stroke-width:2px,color:#ffffff\n    classDef ai fill:#4caf50,stroke:#ffffff,stroke-width:2px,color:#ffffff\n    classDef backend fill:#2196f3,stroke:#ffffff,stroke-width:2px,color:#ffffff\n    classDef storage fill:#9c27b0,stroke:#ffffff,stroke-width:2px,color:#ffffff\n\n    class UI frontend\n    class CF,APIGW,LAMBDA,S3D,S3M aws\n    class LOCAL,FILES,MEMORY storage\n    class BEDROCK,OPENAI,AIAPIS ai\n    class APP,CHAT backend\n```\n\n**Key Features:**\n- **Flexible deployment** - Cloud (AWS serverless) or Local development\n- **Real-time responses** from AI providers\n- **Multi-AI provider** support (AWS Bedrock, OpenAI)\n- **Adaptive data storage** - S3 for cloud, local files for development\n- **Security controls** and validation\n\n📖 For detailed architecture information and deployment guide, see **[Architecture \u0026 Deployment](docs/ARCHITECTURE.md)**.\n\n## Data Management\n\n### Current Setup (Separate Private Repo)\n\nThis project is currently configured to keep personal data separate from the main codebase. Personal data is stored in a private repository and encrypted for deployment.\n\n### Alternative: Local Data Approach\n\nA simpler local approach by committing personal data to `backend/data` directory:\n\n1. **Copy the templates** from `backend/data/personal_data_templates/` to `backend/data/personal_data/`\n2. **Edit the files** with your actual information:\n   - `facts.json` - Structured facts about you\n   - `summary.txt` - Personal summary\n   - `style.txt` - Your communication style\n   - `linkedin.pdf` - Your LinkedIn profile as PDF\n   - `me.txt` - Additional personal description (optional)\n\n3. **Copy prompt templates** from `backend/data/prompts_template/` to `backend/data/prompts/`\n\n**Quick setup command**:\n```bash\n./scripts/setup-local-data.sh\n```\n\n📖 For detailed information about data files, formats, and the data loader system, see the **[Data Guide](backend/data/DATA_ARCHITECTURE.md)**.\n\n## Customization\n\n### Avatar\n\nTo use your own avatar image:\n\n1. Replace the avatar file in `frontend/public/avatar.png` with your own image\n2. Recommended size: 200x200px or larger (square aspect ratio)\n3. Supported formats: PNG, JPG, or any web-compatible image format\n\nThe avatar will automatically appear in the chat interface.\n\n### Personalize Names and Text\n\nEdit `frontend/app/page.tsx` to customize:\n- Digital twin name (default: \"Luna\")\n- Your name and title\n- Header and footer text\n\n## Getting Started - Local Development\n\n⚠️ **Cost Warning**: Local development using OpenAI will incur API costs based on your usage. OpenAI charges per token (input/output). Monitor your usage at [OpenAI's usage dashboard](https://platform.openai.com/usage). Alternatively, you can use AWS Bedrock which also has associated costs.\n\n### Prerequisites\n- Python 3.11+\n- Node.js 18+\n- OpenAI API key (or AWS credentials for Bedrock)\n\n### Setup Steps\n\n1. **Install dependencies**:\n```bash\n# Backend\ncd backend\nuv sync\n\n# Frontend\ncd frontend\nnpm install\n```\n\n2. **Set up your personal data** (see Data Management section above)\n\n3. **Configure environment variables** (optional):\n\nFor local development, you can use OpenAI instead of AWS Bedrock. Copy the example environment file and configure it:\n\n```bash\ncd backend\ncp .env.example .env\n# Edit .env and set AI_PROVIDER=openai and your OPENAI_API_KEY\n```\n\nSee `backend/.env.example` for all available configuration options.\n\n4. **Start the backend** (Terminal 1):\n```bash\ncd backend\nuv run server.py\n```\nBackend runs on `http://localhost:8000`\n\n5. **Start the frontend** (Terminal 2):\n```bash\ncd frontend\nnpm run dev\n```\nFrontend runs on `http://localhost:3000`\n\n### Test Your Local Setup\n\n1. Open your browser to `http://localhost:3000`\n2. You should see the chat interface with your avatar\n3. Start chatting with your digital twin!\n\n---\n\n## Cloud Deployment\n\n⚠️ **Cost Warning**: Deploying to AWS will incur cloud infrastructure costs that are your responsibility. See the **[Cost Disclaimer](docs/ARCHITECTURE.md#cloud-deployment-guide)** section in the architecture guide for details.\n\nWilling to deploy to AWS? See the **[Architecture \u0026 Deployment Guide](docs/ARCHITECTURE.md)** for instructions. Once setup:\n\n**Quick deploy:**\n```bash\n./scripts/deploy.sh dev\n```\n\n---\n\n## Project Structure\n\n```\ndigital-twin/\n├── backend/           # FastAPI backend\n│   ├── app/          # Application code\n│   ├── data/         # Personal data and prompts\n│   └── tests/        # Backend tests\n├── frontend/         # Next.js frontend\n│   ├── app/          # Next.js app directory\n│   └── components/   # React components\n├── terraform/        # Infrastructure as Code\n├── scripts/          # Deployment and utility scripts\n└── docs/            # Documentation\n```\n\n\n---\n\n## License\n\nSee [LICENSE](LICENSE) file for details.\n\n---\n\n**More screenshots and documentation coming soon...**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdilettacal%2Fdigital-twin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdilettacal%2Fdigital-twin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdilettacal%2Fdigital-twin/lists"}