Skip to content
Proyectos

Edge-AI-HQ/proactive-assistant

Ver en GitHub

Acerca de

The proactive personal AI that acts before you ask. Connects your apps and devices, builds a lifelong memory, and surfaces proactive cards. Web, macOS and iOS.

Desarrollo web y de aplicaciones

Cómo se miden estas cifras

What you can do

  • Proactive cards. A generator agent looks at what changed in your world and decides whether anything deserves your attention. Most runs produce nothing; when something matters, you get a card with the context and a suggested next step.
  • Lifelong memory. Raw data from your sources (L0) is projected into an append-only, bi-temporal event log (L1) and distilled into a portrait of you (L2). A background evolve agent keeps consolidating and curating it.
  • Connectors. Gmail, Google Calendar, Drive, Docs, Sheets, Slack, GitHub, Notion, LinkedIn, Calendly, Stripe and YouTube through Composio, plus on-device signals such as health data, places you visit and ambient audio from the iOS app.
  • An agent that can act. Chat with an agent that searches your memory, runs Python in a cloud sandbox, drives a real browser and calls your connected apps. Side-effecting actions need your approval, and clicks on destructive buttons (pay, delete, transfer, ...) always hand control back to you.

Crecimiento de estrellas medido

in 24h
+1
in 7 days
+5
in 15 days
Recopilando historial
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

PIN AI — the proactive personal AI that acts before you ask

License: MIT Python 3.12+ TypeScript Platforms: web, macOS, iOS

Web app · Quick start · How it works · Docs · Contributing

PIN AI is an open-source personal AI that works for you in the background. It connects to the apps and devices you already use, builds a long-term memory of your life, and turns what it learns into proactive cards: short, actionable suggestions that show up before you think to ask. When you want something done, its agent can search your memory, browse the web, run code and use your connected apps, with you in the loop for anything that can't be undone.

PIN AI on the desktop: a proactive card opened with why-now context, sources and the agent's reasoning PIN AI iOS app showing the proactive card feed

Features

  • Proactive cards. A generator agent looks at what changed in your world and decides whether anything deserves your attention. Most runs produce nothing; when something matters, you get a card with the context and a suggested next step.
  • Lifelong memory. Raw data from your sources (L0) is projected into an append-only, bi-temporal event log (L1) and distilled into a portrait of you (L2). A background evolve agent keeps consolidating and curating it.
  • Connectors. Gmail, Google Calendar, Drive, Docs, Sheets, Slack, GitHub, Notion, LinkedIn, Calendly, Stripe and YouTube through Composio, plus on-device signals such as health data, places you visit and ambient audio from the iOS app.
  • An agent that can act. Chat with an agent that searches your memory, runs Python in a cloud sandbox, drives a real browser and calls your connected apps. Side-effecting actions need your approval, and clicks on destructive buttons (pay, delete, transfer, ...) always hand control back to you.
  • Web, macOS and iOS. One shared TypeScript layer powers a React web app, an Electron desktop shell and an Expo / React Native iOS app.
  • Secure by design. The agent runtime is an untrusted process: it never sees master credentials and talks to the trusted API with short-lived, Ed25519-signed per-run tokens.

How it works

flowchart LR
  subgraph Clients
    Web["Web · React"]
    Desktop["macOS · Electron"]
    IOS["iOS · Expo"]
  end
  Clients -->|"HTTPS / SSE"| API["api<br/>trusted · FastAPI"]
  API -->|"signed per-run JWT"| Engine["agent-engine<br/>untrusted · LangGraph + DeepAgents"]
  API --> DB[("Postgres + pgvector")]
  API --> Redis[("Redis")]
  API --> Composio["Composio<br/>connected apps"]
  Engine --> DB
  Engine --> LiteLLM["LiteLLM"] --> LLMs["LLM providers"]
  Engine --> Tools["Daytona sandbox<br/>Browserbase browser"]
  Reward["reward-dashboard<br/>read-only review tool"] --> DB

The backend is a Python uv workspace with three services that never import each other:

  • api (pinai_api) is the trusted edge. It owns auth, connectors, billing, scheduling and the product domains, and it is the only process that holds master credentials.
  • agent-engine (agent_engine) runs every LLM agent: chat, card generation, memory evolution. It treats its input as untrusted and reaches your data only through the api with a per-run token.
  • reward-dashboard (pinai_reward_dashboard) backs an internal tool for reviewing generated cards. It reads the product database and holds no master credentials.

All model calls go through LiteLLM, so providers can be swapped by configuration. On the frontend, cross-platform logic and UI live in packages/* (core, design, state, ui-kit), and each app in apps/* is a thin platform shell.

Memory architecture

Memory is a hybrid RAG system with three storage layers (raw → events → portrait), one retrieval entry point, and no LLM on the online path.

Memory architecture: sources are ingested into L0 raw tables, projected by deterministic rules (no LLM) into the L1 event stream, and retrieved through events_search (pre-filter, semantic and keyword lanes, RRF fusion) by the agents. The L2 portrait is injected into every run. rollup_semantic and evolve are the only LLM steps and run asynchronously. event_source drills any result back to its original document.

Key design decisions:

  • No LLM on the online path. Ingest, projection and retrieval are deterministic. The two LLM steps, rollup_semantic and evolve, run asynchronously in the background.
  • Filter first, then two lanes. Time and type filters run before any vector search. The semantic and keyword lanes are fused by rank (RRF, k = 60), because cosine and ts_rank scores aren't comparable.
  • Objective ranking, no LLM scores. The semantic lane ranks by similarity × event-type prior × 30-day half-life recency × (1 + ln(1 + references)). Only agent retrievals count as references; browsing the timeline doesn't.
  • History is immutable, the present is mutable. L0 and L1 are append-only, and a correction is a new version that supersedes the old one. L2 is edited in place, and every memory_edit also appends a change event to L1 in the same transaction.
  • Provenance on every result. event_source drills any result back to its original document, resolved to the current version even when the caller holds an old id.
  • One read entry point. Chat, card generation and proactive runs all read through events_search; the agent's memory tools went from 21 to 4.
  • Eval harness. Fixed queries with a ground-truth answer key (sha256-hashed) score events_search with recall@k, MRR and nDCG@k (backend/tests/eval/memory).

The full design is in docs/modules/memory.mdx.

Quick start

Prerequisites: Docker Desktop, Node.js 20+, Python 3.12+ with uv, and Xcode if you want to build the iOS app.

git clone https://github.com/Edge-AI-HQ/proactive-assistant.git
cd proactive-assistant
(cd backend && uv sync)
npm install
cp backend/.env.example backend/.env           # then fill in your own values
cp ops/litellm/.env.example ops/litellm/.env
make up      # build and start postgres, redis, litellm, api, agent-engine, reward-dashboard and the web app
make urls    # print the local ports of this checkout's stack

[!NOTE] The .env.example files list every variable the stack reads, with empty values. Fill in the ones you need (for example your own Supabase project and LLM provider keys) and leave integrations you don't use empty. The maintainers' encrypted env files are not part of this public repository.

To work on a single piece without Docker:

(cd backend && uv run uvicorn pinai_api.asgi:app --reload --port 8000)     # api
(cd backend && uv run uvicorn agent_engine.asgi:app --reload --port 8001)  # agent-engine
(cd apps/web && npm run dev)                                               # web app on :3005
make macos                                                                 # Electron desktop shell
make rn SIM=1                                                              # iOS app in the simulator

Run the checks before opening a pull request:

(cd backend && uv run ruff format --check && uv run ruff check && uv run lint-imports && uv run mypy services libs && uv run pytest)
npm run check:packages
(cd apps/web && npm run type-check && npm test)

The full command reference, including which checks to run for each kind of change, is in AGENTS.md.

Project structure

backend/                     Python uv workspace
  services/api/              trusted api process (FastAPI)
  services/agent-engine/     untrusted agent runtime (LangGraph + DeepAgents)
  services/reward-dashboard/ backend of the internal card review tool
  libs/contracts/            protocol shared by api and agent-engine
  libs/db/                   shared database foundation
  db/migrations/             forward-only SQL migrations (yoyo)
packages/                    shared TypeScript layer: core, design, state, ui-kit
apps/web/                    web app (Vite + React)
apps/desktop/                macOS shell (Electron), reuses apps/web
apps/mobile/                 iOS app (Expo / React Native)
internal-reward-dashboard/   internal card review tool (Vite + React)
ops/litellm/                 LiteLLM gateway configuration
docs/                        module docs and design plans

Documentation

  • docs/ has one document per module (connectors, memory, generation, execution, feedback, background tasks, runtime and deployment) plus design plans. The module docs are in English; the design plans under docs/plans/ are still in Chinese.
  • AGENTS.md is the single source of truth for architecture rules, hard constraints and coding conventions. It is written for both human contributors and AI coding agents.

Contributing

This repository is a read-only public mirror of the maintainers' development repository, so pull requests are turned off here. Bug reports and feature requests are welcome as issues; see CONTRIBUTING.md. To report a security issue, follow SECURITY.md instead of opening a public issue.

License

PIN AI is released under the MIT License. The license covers the code; the "PIN AI" name and logo are not licensed for use in derived products.

Acknowledgements

PIN AI is built on top of excellent open-source projects, including LangChain and LangGraph, DeepAgents, LiteLLM, FastAPI, Expo, Electron, Vite and TanStack Query, and on services from Supabase, Composio, Daytona and Browserbase.

Explorar proyectos relacionados

Cargando…