Skip to content

jesseboudreau80/BarkMind

Repository files navigation


🐾 BarkMind

Canine Behavioral Intelligence Platform

The open research infrastructure for structured canine behavioral data

Platform API Backend Frontend Database Governance License

Live Platform  ·  API Docs  ·  Contribute  ·  Governance Status


What is BarkMind?

BarkMind is not a pet social media platform. It is research infrastructure for canine behavioral science.

Professional dog trainers, shelter behaviorists, groomers, and veterinary staff encounter behavioral incidents every day. Those encounters generate expert knowledge that almost always disappears — into notebooks, case files, and memory. BarkMind captures that knowledge in a structured, searchable, auditable format and builds it into a dataset that behavioral AI can actually learn from.

The core loop:

Professional submits behavioral incident
  → Community annotates with controlled vocabulary
  → Verified experts review and file formal verdicts
  → Multi-expert consensus resolves complex cases
  → Evidence locks — case becomes an immutable dataset entry

The platform is operational, governed, and open to professional contributors.


Live Platform

Service URL Status
Frontend https://barkmind.jesseboudreau.com Status
Backend API https://barkmind-api.jesseboudreau.com Status
API Documentation https://barkmind-api.jesseboudreau.com/docs OpenAPI / Swagger
Governance Status https://barkmind-api.jesseboudreau.com/governance/status Aegis-compatible

Demo Access

The live platform includes realistic demo cases with verified expert profiles. To access admin or expert features, open an issue using the Expert Verification template or contact the maintainer.


Architecture

Visual architecture diagram: docs/assets/architecture.svg

┌─────────────────────────────────────────────────────────────┐
│                    Cloudflare Edge                          │
│         TLS 1.3 · DDoS Protection · WAF · HTTP/2           │
└─────────────────┬───────────────────────────────────────────┘
                  │ Named Tunnel: reselleros
                  │
    ┌─────────────┴──────────────────────────┐
    │              VM: vmi3002990             │
    │                                         │
    │  ┌──────────────┐  ┌──────────────┐   │
    │  │   Frontend   │  │   Backend    │   │
    │  │ Next.js 16   │  │  FastAPI     │   │
    │  │ :3008        │◄─►  :8108       │   │
    │  │ App Router   │  │  uvicorn     │   │
    │  └──────────────┘  └──────┬───────┘   │
    │                           │            │
    │                    ┌──────▼───────┐   │
    │                    │ PostgreSQL   │   │
    │                    │ 22 tables    │   │
    │                    │ 73-term      │   │
    │                    │ taxonomy     │   │
    │                    └──────────────┘   │
    │                                        │
    │  ┌──────────────────────────────────┐ │
    │  │ Aegis AI — Governance Control    │ │
    │  │ Audit events · Topology registry │ │
    │  └──────────────────────────────────┘ │
    └────────────────────────────────────────┘

Supervision: systemd (barkmind-backend.service, barkmind-frontend.service)
Ingest:      Cloudflare Named Tunnel (no raw ports exposed)
Auth:        JWT Bearer — python-jose + passlib bcrypt
Media:       Pillow + ffmpeg — local disk (S3-ready abstraction)

Feature Overview

Behavioral Intelligence Layer

Feature Description
Case Submission Upload video/images with incident description, setting, trigger context
Behavioral Taxonomy 73 controlled terms across 14 categories (body posture, tail position, eye contact, stress indicators, arousal, social engagement, and more)
Structured Annotations Typed annotations (observation/interpretation/concern/recommendation) with confidence levels and timestamp ranges
Timeline Markers Named behavioral events pinned to exact video timestamps (trigger, escalation, de-escalation, handler intervention)
Expert Resolutions Formal verdicts: Safe / Concern / Escalation Risk / Requires Intervention
Multi-Expert Consensus Structured opinion aggregation — vote counting, not AI-generated
Evidence Locking Resolved cases freeze with immutable snapshots → permanent dataset entries

Governance Layer

Feature Description
Immutable Audit Trail Every action logged in append-only audit_events table
Expert Verification Credential verification (CPDT, CAAB, CBCC, Fear Free) by admins
Reputation System Event-driven accumulation — +5 resolution, +2 consensus alignment, etc.
Review Assignments Claim/transfer/escalate workflow with traceability
Export Traceability Every data export logged in export_jobs — who requested what, when
Dataset Snapshots Point-in-time metadata capture for version tracking and citation

Research Infrastructure

Feature Description
Annotation Lineage Full provenance chain: author credentials + confidence + revision history
Inter-Rater Analysis Endpoint for IRR data extraction (Cohen's kappa ready)
NDJSON Export Streaming dataset export for ML pipelines
Provenance API GET /dataset/lineage/{case_id} returns complete annotation chain
Taxonomy API GET /taxonomy returns structured vocabulary with severity and signal type

Database Schema

22 tables across 6 layers:

Core:        users, cases, case_media, tags, case_tags, comments
Annotation:  annotations, annotation_taxonomy_refs, annotation_revisions
Taxonomy:    taxonomy_terms
Timeline:    timeline_markers
Resolution:  expert_resolutions
Trust:       expert_profiles, review_assignments, consensus_records,
             expert_opinions, evidence_locks, audit_events, reputation_events
Operations:  export_jobs, dataset_snapshots, organizations

Migration chain (Alembic):

249e14807858 → initial_schema
759b2d6bccd0 → add_media_thumbnails
9c08dac2316e → phase4_annotation_intelligence
c1d10499127d → phase5_trust_infrastructure
b698e6352af2 → phase6_operational_intelligence

Quickstart (Local Development)

Option A: Docker (Recommended)

git clone https://github.com/yourusername/BarkMind.git
cd BarkMind
docker compose up
# → Backend: http://localhost:8108/health
# → Frontend: http://localhost:3008

Option B: Native

Prerequisites

python3 --version  # 3.12+
node --version     # 22+
psql --version     # PostgreSQL 18+
ffmpeg -version    # for video thumbnails

Backend

# 1. Clone and configure
git clone https://github.com/yourusername/BarkMind.git
cd BarkMind
cp .env.example .env
# Edit .env: set DATABASE_URL, JWT_SECRET

# 2. Database setup
sudo -u postgres psql <<SQL
CREATE USER barkmind_user WITH PASSWORD 'yourpassword';
CREATE DATABASE barkmind OWNER barkmind_user;
GRANT ALL PRIVILEGES ON DATABASE barkmind TO barkmind_user;
\connect barkmind
GRANT ALL ON SCHEMA public TO barkmind_user;
SQL

# 3. Run migrations + seed
cd backend
pip install -r requirements.txt
alembic upgrade head
# Tags and taxonomy seed automatically on first backend startup

# 4. Start backend
cd backend
uvicorn app.main:app --host 127.0.0.1 --port 8108 --reload

Frontend

# 5. Install and build
cd frontend
npm install
npm run build   # uses --webpack (required for VM stability)

# 6. Start frontend
npm run start   # runs on :3008

Using lifecycle scripts (production)

./start.sh    # starts both services via systemd
./status.sh   # shows service state, ports, health
./stop.sh     # graceful stop
./restart.sh  # restart both services

Verify

curl http://127.0.0.1:8108/health   # {"status":"ok","service":"barkmind"}
curl http://127.0.0.1:3008/         # 307 → /home

Contributing

BarkMind is open to professional contributors. You don't need to be a developer.

Who Should Contribute

  • Dog trainers (CPDT, CBCC, KPA-CTP) — submit training session breakdowns
  • Shelter staff — document intake behavioral assessments
  • Groomers — submit fear response and stress escalation cases
  • Veterinary staff — document restraint stress and fear protocol cases
  • Daycare leads — submit group play escalation and overarousal incidents
  • Students — annotate existing cases using the behavioral taxonomy

Ways to Contribute

Type Who How
Submit a case Any registered user Upload → /upload
Annotate a case Any registered user Browse /cases → add annotation
Expert review Verified professionals /expert — claim and resolve cases
Code contribution Developers See CONTRIBUTING.md

Developer Setup

# Backend tests
cd backend && pytest

# Frontend lint
cd frontend && npm run lint

# Type check
cd frontend && npx tsc --noEmit

See docs/CONTRIBUTOR_QUICKSTART.md for full onboarding.


The Behavioral Taxonomy

BarkMind uses a curated 73-term controlled vocabulary across 14 categories:

body_posture           tail_position          ear_position
eye_contact            mouth_tension          stress_indicators
fear_indicators        play_signals           arousal_escalation
social_engagement      avoidance              resource_guarding
handler_intervention   environmental_triggers

Each term has:

  • severity_hint (0–4): informational → mild → moderate → elevated → severe
  • signal_type: threat / appeasement / stress / fear / arousal / play / social / avoidance / resource / handler / trigger / neutral

Browse the live taxonomy: barkmind.jesseboudreau.com/tags
Full taxonomy doc: docs/BEHAVIORAL_TAXONOMY.md


Dataset Governance

BarkMind is designed from the ground up to produce a trustworthy, citable research dataset.

Provenance

Every annotation records:

  • Author username and role at time of creation
  • Expert verification status
  • Confidence level (high/medium/low)
  • Timestamp range (for video)
  • Taxonomy terms referenced
  • Full revision history

Evidence Integrity

Resolved cases are locked with immutable snapshots. After locking:

  • No new annotations can be added
  • Existing annotations cannot be modified
  • Media cannot be deleted
  • A snapshot of complete case state is stored permanently

Audit Trail

Every significant action creates an append-only AuditEvent record. Nothing can be modified or deleted without a trace. Audit log is accessible to admin via API.

Attribution

Contributors retain attribution on every annotation. If BarkMind's dataset contributes to published research or trained models, contributors are credited.

Full governance documentation: docs/GOVERNANCE_WORKFLOW.md


Roadmap

Phase 1-6:  ✅ Platform foundation (backend, frontend, media, annotation, trust, governance)
Phase 7-9:  ✅ Deployment, stability, systemd supervision
Phase 10:   ✅ Port governance and lifecycle hardening
Phase 11:   ✅ Demo dataset — 11 cases, 5 experts, 73-term taxonomy
Phase 12:   ✅ Public presentation — landing page, contributor hub, about page

Phase 13:   🔄 Community activation (this phase)
              Open source docs, ethics statement, annotation standards

Phase 14:   📋 Multimodal annotation
              Frame extraction · Claude API integration · per-frame behavioral labels

Phase 15:   📋 Research dataset release
              Open dataset · NDJSON export · contributor attribution · DOI

Phase 16:   📋 Behavioral AI foundations
              Escalation prediction · risk scoring · trained on locked cases

Ethics and Safety

BarkMind is committed to responsible development of behavioral AI.

  • No autonomous conclusions. BarkMind produces human-labeled data. AI does not generate verdicts.
  • No veterinary diagnosis. All platform output is behavioral observation, not medical diagnosis.
  • No misrepresentation. AI summaries (when implemented) include explicit disclaimers.
  • No hallucination risk. Structured scoring uses bounded enumerations, not free generation.
  • Contributor attribution. Experts are credited on every annotation they create.

Full ethics statement: docs/ETHICS_AND_SAFETY.md


Tech Stack

Layer Technology
Frontend Next.js 16 (App Router, webpack) · TypeScript · Tailwind CSS 4 · SWR
Backend FastAPI · Python 3.12 · SQLAlchemy 2 (async) · Pydantic v2
Database PostgreSQL 18 · asyncpg · Alembic
Auth JWT Bearer · python-jose · passlib bcrypt
Media Pillow · ffmpeg · local disk (S3-ready storage abstraction)
Deployment systemd · Cloudflare Named Tunnel · uvicorn
Governance Aegis AI control plane · immutable audit_events

Project Structure

BarkMind/
├── backend/
│   ├── app/
│   │   ├── models/          # 22 SQLAlchemy models
│   │   ├── routers/         # 15+ FastAPI route modules
│   │   ├── schemas/         # Pydantic schemas
│   │   ├── services/        # Business logic layer
│   │   └── scripts/         # Seeding and utilities
│   ├── alembic/             # Migration chain
│   └── requirements.txt
├── frontend/
│   └── src/
│       ├── app/             # Next.js App Router pages
│       ├── components/      # Shared component library
│       ├── contexts/        # Auth context
│       └── lib/             # API client, types, utils
├── config/                  # Aegis manifests, registry entry
├── docs/                    # 70+ documentation files
├── prompts/                 # AI prompt library
├── media/                   # Local media storage
├── start.sh / stop.sh / restart.sh / status.sh
└── README.md

Related Documentation

Document Purpose
docs/ARCHITECTURE_OVERVIEW.md Full technical architecture
docs/BEHAVIORAL_TAXONOMY.md 73-term vocabulary reference
docs/GOVERNANCE_WORKFLOW.md Case lifecycle and governance
docs/ETHICS_AND_SAFETY.md Ethics statement
docs/CONTRIBUTOR_QUICKSTART.md Onboarding for new contributors
docs/FIRST_CASE_REVIEW.md Expert reviewer guide
docs/ANNOTATION_STANDARDS.md Annotation quality rubric
docs/DATASET_GOVERNANCE.md Dataset integrity documentation
docs/LIVE_DEMO_SCRIPT.md 15-minute demo walkthrough
docs/LOCAL_DEV_GUIDE.md Local development guide
docs/DEPLOYMENT_GUIDE.md Production deployment guide

License

MIT License. See LICENSE for details.

Behavioral vocabulary terms are released under CC BY 4.0.

Dataset exports include full contributor attribution per the terms in docs/CONTRIBUTOR_PHILOSOPHY.md.


Founders

Jesse Boudreau

Co-Founder, Product Lead, and Principal Architect

Responsible for platform vision, AI architecture, engineering strategy, software development, and product direction.

Darcee Sellers

Co-Founder, Canine Behavior Consultant, and Customer Experience Lead

Responsible for canine behavior expertise, pet care consulting, workflow design, customer experience strategy, product validation, documentation, and operational planning.

Together, Jesse and Darcee founded BarkMind to improve canine behavior understanding, pet care operations, and outcomes for pets, pet parents, trainers, groomers, boarding facilities, and veterinary teams through responsible use of AI and technology.


About BarkMind

BarkMind is a founder-led project created by Jesse Boudreau and Darcee Sellers.

Combining decades of experience in pet care operations, canine behavior, customer experience, leadership, compliance, and technology, BarkMind is designed to help pet professionals better understand, document, and improve canine behavior through practical AI-powered tools.


Governance

BarkMind is a governed service running under the Aegis AI control plane.

# Governance status (no auth required)
curl https://barkmind-api.jesseboudreau.com/governance/status

# Aegis metadata
curl https://barkmind-api.jesseboudreau.com/.well-known/aegis-meta

Founded by Jesse Boudreau & Darcee Sellers · Built by the behavioral professional community

barkmind.jesseboudreau.com · Contribute · API

About

Open-source initiative to build the world's most comprehensive canine behavioral intelligence dataset.

Topics

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors