ryan 5809ad3adb
CI / backend (pull_request) Successful in 42s
CI / frontend (pull_request) Failing after 7s
CI / backend (push) Successful in 41s
CI / frontend (push) Failing after 7s
Add durable chat runs, shared agent runtime, reliable jobs, history tools and citations
Shared runtime
- One agent entry point (runtime.invoke_agent_for_user / prepare_agent_turn) for
  web, email, iMessage, WhatsApp, scheduled and cron, so identity, permissions,
  memories, summaries and metrics match across channels.
- Serialize turns per checkpoint thread; /query validates input and returns 409
  while a durable run owns the conversation.

Reconnectable chat (durable runs)
- POST /runs creates an idempotent, owner-scoped run; GET .../events replays an
  ordered SSE log by cursor, so generation survives refresh and device switches.
  Stop cancels; disconnect only detaches. /stream-query is a compatibility adapter.
- Coalesce streamed deltas (150 ms) and wake same-process subscribers instead of
  polling; keep buffered text when a run is stopped.
- Drain runs on shutdown; serve via Hypercorn with a shutdown timeout covering
  the drain (and no longer in debug mode). CHAT_RUN_* settings are forwarded.

Scheduled messages and cron
- Atomic delivery claims, attempt history and explicit retries; ambiguous sends
  become "uncertain" and are never resent automatically.
- Cron triggers need a run_id/Idempotency-Key; legacy jobs need an explicit owner.
- Cancelling never rewrites a started delivery; series stop via tombstones.
  Legacy sent rows are not forked into new series. Malformed bodies return 400.

History, integrations and retrieval
- Message-content search, pinned conversations, JSON/Markdown export and a
  memory editor.
- Integration status panel and YNAB data-freshness provenance.
- Date-filtered document/note search with stable citations and a source viewer.

Migration 20 is generated by aerich.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:11:04 -04:00
2026-01-31 17:13:27 -05:00
2026-01-31 22:47:43 -05:00
2026-01-31 17:13:27 -05:00
2026-10-12 17:58:14 -04:00
2026-01-31 16:20:35 -05:00
2026-03-03 08:23:31 -05:00

SimbaRAG

SimbaRAG is a personal assistant with a Quart backend and React 19 frontend, document retrieval, persistent conversations, and configurable household integrations.

PostgreSQL stores application data and pgvector stores document embeddings (simba_docs). LangGraph checkpoints and conversation summaries use separate SQLite files on a persistent volume. Chat uses an OpenAI-compatible llama-server when configured, with OpenAI gpt-5-mini fallback; without llama-server it uses OpenAI directly. Embeddings use a configured OpenAI-compatible server or OpenAI text-embedding-3-small. Ollama is used by image/PDF helper workflows.

Setup

Install Python 3.13, uv 0.7.2, Node 22.14.0, and Docker Compose v2. From the repository root:

cp .env.example .env
# Edit .env before starting services; it is deliberately not deployable as-is.
uv sync --frozen --extra test
cd raggr-frontend
npm ci
npm run build
cd ..

Set DATABASE_URL, JWT_SECRET_KEY, FERNET_KEY, and OPENAI_API_KEY. Use a random database password and match it to POSTGRES_PASSWORD if using the included PostgreSQL service. OpenAI fallback and encrypted model fields initialize even when their integrations are otherwise unused. Optional integration credentials can remain empty in validation. The current Tavily client initialization still needs TAVILY_API_KEY at app import time; making it optional requires an application change. Configure all OIDC fields together to enable browser login.

For local backend development, start only PostgreSQL with docker compose up -d postgres, set DATABASE_URL to the host connection (localhost:5432), and use local writable checkpoint paths. Then:

uv run --frozen aerich upgrade
uv run --frozen python app.py

See the development guide for new database initialization, frontend development, and CI checks. For production configuration and blue/green services, see the deployment guide.

Agent tools and integrations

Tools are selected per request by the tool router. The current tool families include:

  • Document retrieval (simba_search) and Tavily web search (web_search).
  • Obsidian note search/read/create, journal tasks, and saved user memory.
  • Mealie recipes, meal plans, and shopping lists.
  • Google Calendar and Gmail, using the OAuth token file; access is gated by the router.
  • SimbaKit/PetKit device status, weight, litter, and drinking history.
  • Beli restaurant lists; credentials are stored encrypted per profile.
  • Admin integrations: YNAB mirror SQL, Homebox inventory through homebox-mcp, and BookStack wiki through bookstack-mcp.

The application also supports WhatsApp (Twilio), email (Mailgun), iMessage (SendBlue), scheduled messages, and Cronicle triggers. Integration availability and access depend on credentials and user role. Tool schemas being present does not imply an integration is configured.

Checks and operations

make test             # backend unit tests; no deployment secrets required
make evaluate         # deterministic context fixture evaluation
make lint             # Ruff 0.8.2, matching pre-commit/CI
make frontend-check   # locked install, renderer tests, TypeScript, build
make validate-config  # production policy; prints setting names, not secrets

Gitea Actions runs backend Ruff/unit/evaluation and frontend renderer/typecheck/build checks independently. Python dependencies come from uv.lock; frontend dependencies come from raggr-frontend/package-lock.json with npm ci.

The production Makefile detects the active blue/green color for make logs, make migrate, and make migrate-history. make redeploy pulls the current branch and invokes scripts/deploy.sh; run it only when an actual deployment is intended. make reindex clears and rebuilds documents; make reindex-obsidian rebuilds only Obsidian documents. make ynab-sync performs a delta mirror sync and make ynab-resync a full download.

Further documentation: pgvector management, authentication, context management, and desktop client.

S
Description
No description provided
Readme 16 MiB
Languages
Python 73.9%
TypeScript 17.4%
HTML 3.5%
JavaScript 3.4%
Rust 0.5%
Other 1.3%