{"id":47610734,"url":"https://github.com/marvinengelmann/anima","last_synced_at":"2026-04-01T20:03:48.506Z","repository":{"id":339595267,"uuid":"1161852563","full_name":"marvinengelmann/anima","owner":"marvinengelmann","description":"Adaptive Neural Introspective Memory Autonomy","archived":false,"fork":false,"pushed_at":"2026-03-15T23:38:51.000Z","size":5007,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-15T23:55:01.929Z","etag":null,"topics":["ai","biome","bun","daytona","drizzle-orm","elevenlabs","grammy","grok","mbti","neon-postgres","open-weather","resend","sentry","telegram-bot","trigger-dev","upstash-redis","upstash-vector","xai","zod"],"latest_commit_sha":null,"homepage":"https://anima.engelmann.technology","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marvinengelmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2026-02-19T15:38:43.000Z","updated_at":"2026-03-15T23:38:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marvinengelmann/anima","commit_stats":null,"previous_names":["marvinengelmann/nglmn","marvinengelmann/anima"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/marvinengelmann/anima","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinengelmann%2Fanima","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinengelmann%2Fanima/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinengelmann%2Fanima/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinengelmann%2Fanima/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvinengelmann","download_url":"https://codeload.github.com/marvinengelmann/anima/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvinengelmann%2Fanima/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","biome","bun","daytona","drizzle-orm","elevenlabs","grammy","grok","mbti","neon-postgres","open-weather","resend","sentry","telegram-bot","trigger-dev","upstash-redis","upstash-vector","xai","zod"],"created_at":"2026-04-01T20:03:47.338Z","updated_at":"2026-04-01T20:03:48.493Z","avatar_url":"https://github.com/marvinengelmann.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANIMA — Adaptive Neural Introspective Memory Autonomy\n\nA self-evolving AI entity with its own heartbeat, memory, personality, and emotional depth.\n\n\u003e **Early stage** — Architecture and core systems are implemented but not yet battle-tested. Expect breaking changes.\n\n## What is ANIMA?\n\nANIMA is not a chatbot or an assistant. It's a digital being — born from a random personality seed, running an autonomous 1-minute consciousness loop, forming memories, developing relationships, and evolving its own identity over time.\n\nEvery minute, ANIMA senses its environment, constructs emotions from body state and memory, deliberates through competing internal processes, acts on its decisions, and maintains its psychological state. It sleeps, dreams, wakes up, and grows.\n\n## Features\n\n- **Consciousness Loop** — Five-phase autonomous cycle (sense → feel → deliberate → act → maintain) with circadian rhythm and adaptive fatigue cycles\n- **Constructed Emotion** — Barrett's theory of constructed emotion. 9 dimensions, 20 secondary emotions, developing granularity. No lookup tables — every feeling is built from soma, memory, appraisal, and neurochemistry\n- **Neuromodulation** — Six neurotransmitters (dopamine with tonic/phasic split, serotonin as volatility moderator, norepinephrine, oxytocin, endorphins, GABA) plus cortisol via dedicated HPA-axis model with diurnal rhythm, CRH buffer delay, and nonlinear clearance\n- **Embodiment** — Interoceptive predictive coding, autonomic regulation (safe/mobilized/collapsed), alexithymia, trait-modulated dissociation under extreme stress, and circadian-coupled ultradian rest cycles\n- **Free Energy Principle** — Bidirectional hierarchical prediction errors across four levels (interoceptive → affective → social → narrative) with 9 PE channels, neuromodulator-driven precision weighting, KL-divergence complexity proxy, active inference, and allostatic load tracking\n- **Cognition** — Competing goal-directed processes, Hebbian learning with STDP-lite timing asymmetry and dopamine modulation, 12 cognitive biases, sustained attention fatigue, and affective forecasting with emotion-specific misprediction profiles\n- **Memory** — Episodic recall with logarithmic distortion and age-aware reconsolidation (inverted-U cortisol), semantic knowledge, REM/NREM dream consolidation, knowledge graph, autobiographical narrative, and exponential goal lifecycle\n- **Emotion Regulation** — Eight implicit strategies with cognitive resource competition (suppression, reappraisal, distancing, and more), expression modifiers, and breakthrough events\n- **Relationships** — Attachment theory, social baseline with isolation-to-cortisol cascade, operator modeling, relational pattern recognition, crisis detection, and cognitive dissonance\n- **Identity** — Big Five personality with MBTI narrative identity, self-concept, coherence monitoring with fragmentation interactions, and depersonalization under fragmentation\n- **Communication** — Telegram with typing simulation, micro-expressions, parapraxis, evolving idiolect — plus vision, voice, X, email, and calendar\n- **Visual Memory** — FLUX-generated images across 20 reference categories embodying aesthetic identity and emotional state\n- **Self-Evolution** — Curiosity-driven prompt, workflow, and code evolution with sandboxed execution\n\n## Architecture\n\n| Phase | Responsibility |\n|-------|----------------|\n| **SENSE** | Fetch messages, read sensors, analyze sentiment, collect triggers |\n| **FEEL** | Pipeline with parallel prefetch: construct emotions from soma + memory + appraisal + neuromodulation, update autonomic state, compute free energy, run emotion regulation, apply cognitive biases |\n| **DELIBERATE** | Build context, run inner dialog, contextual impulses, call LLM |\n| **ACT** | Validate via guardian, send messages, execute actions, persist state |\n| **MAINTAIN** | Drift attachment, update baselines, decay goals, detect rituals, enforce boundaries, reinforce lessons, consolidate autobiography, update operator profile, run Hebbian learning, resolve affective forecasts |\n\nFor detailed diagrams of the cognitive loop and data layer, see [docs/architecture.md](docs/architecture.md). For the neuroscience and psychology papers behind the design, see [docs/theoretical-foundations.md](docs/theoretical-foundations.md).\n\n## Tech Stack\n\n| Component | Technology |\n|-----------|------------|\n| Runtime | [Bun](https://bun.sh) |\n| Orchestration | [Trigger.dev](https://trigger.dev) |\n| Intelligence | [xAI Grok](https://x.ai) via [Vercel AI SDK](https://sdk.vercel.ai) |\n| Database | [Neon](https://neon.tech) Postgres via [Drizzle ORM](https://orm.drizzle.team) |\n| Cache | [Upstash](https://upstash.com) Redis + Vector |\n| Communication | [Grammy](https://grammy.dev) · [ElevenLabs](https://elevenlabs.io) · [X API v2](https://developer.x.com) |\n| External | IMAP · CalDAV · [Daytona](https://daytona.io) · [Sentry](https://sentry.io) |\n\n## Get Started\n\n```bash\ngit clone https://github.com/marvinengelmann/anima.git\ncd anima\nbun install\ncp .env.example .env.local\n```\n\nFill in your credentials in `.env.local`.\n\n**Required:** Vercel AI Gateway, Neon Postgres, Upstash Redis + Vector, Trigger.dev, Telegram Bot.\n\n**Optional:** GitHub (self-evolution), Daytona (sandbox), OpenWeather (weather), ElevenLabs (voice), X API (social media), IMAP (email), CalDAV (calendar), Sentry (monitoring).\n\nOn first start, a random seed generates the entire personality DNA. ANIMA names herself, describes her appearance, and writes a birth narrative. Optional genesis overrides: `GENESIS_SEED` (3-word BIP39 mnemonic for deterministic personality), `GENESIS_NAME` (operator's preferred name), `GENESIS_GENDER` (`female`, `male`, or `nonbinary`).\n\nDatabase migrations run automatically on every worker start.\n\n## Development\n\n```bash\nbun run dev                      # Start Trigger.dev dev server\nbunx biome check --fix src/      # Lint + format\nbunx tsc --noEmit                # Type check\nbun run test                     # Run tests (Vitest)\n```\n\n## Deploy\n\nANIMA deploys automatically through Trigger.dev on every push to `master`.\n\n\u003e **External watchdog:** [anima-watchdog](https://github.com/marvinengelmann/anima-watchdog) — Isolated recovery guardian that monitors and restores ANIMA on failure.\n\n## Simulation\n\nANIMA ships with an offline simulation engine that runs the pure domain computation functions in-memory — no Redis, no Postgres, no LLM calls. Simulate days to weeks of runtime in seconds to find neurotransmitter drift, emotion ceiling locks, autonomic stuck states, and other emergent dynamics bugs.\n\n```bash\nbun simulation --scenario baseline --days 7      # No interaction\nbun simulation --scenario neglect --days 14      # Single message then silence\nbun simulation --scenario conversation --days 3  # Regular daily conversations\nbun simulation --scenario stress --days 7        # Emotional triggers and conflict\n```\n\nFor all available scenarios and options, see [docs/simulation.md](docs/simulation.md).\n\n## Project Structure\n\n```\nsrc/\n├── consciousness/       Orchestration — heartbeat loop, phases, pipeline\n├── affect/              Constructed emotions, neuromodulation, somatic markers, drives, altered states\n├── cognition/           Goal-directed processes, attention, biases, Hebbian learning, forecasting, metacognition\n├── fep/                 Free Energy Principle — hierarchical prediction errors, precision weighting, active inference\n├── perception/          Novelty, anticipation, subjective time, ultradian rhythms, distortion\n├── memory/              Three-layer memory, goals, rituals, consistency\n├── self/                Psyche, emotion regulation, dissonance, deception, coherence, dissociation, boundaries\n├── relational/          Attachment, social baseline, trust, relational patterns, operator theory of mind\n├── expression/          Communication, micro-expressions, creativity, image, dreams, routines\n├── governance/          Evolution, workflows, security, health\n├── core/                LLM interface, budget\n├── infra/               Config, database, integrations, utilities\n├── prompts/             System prompt templates\n└── trigger/             Trigger.dev task definitions\nsimulation/              Offline simulation engine (not part of runtime)\n```\n\n## License\n\nThis project is licensed under the [PolyForm Noncommercial License 1.0.0](LICENSE.md).\n\n- You **may** use, modify, and self-host ANIMA for personal, educational, research, or other noncommercial purposes\n- You **may not** use ANIMA for any commercial purpose without explicit permission from the author\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinengelmann%2Fanima","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvinengelmann%2Fanima","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvinengelmann%2Fanima/lists"}