{"id":49245308,"url":"https://github.com/flybits/humanai-agents","last_synced_at":"2026-04-24T21:11:22.963Z","repository":{"id":317404173,"uuid":"1059649781","full_name":"flybits/humanai-agents","owner":"flybits","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-30T16:02:34.000Z","size":1447,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T18:06:08.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flybits.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-09-18T18:30:15.000Z","updated_at":"2025-09-30T16:02:38.000Z","dependencies_parsed_at":"2025-09-30T18:06:26.808Z","dependency_job_id":"b31a71a8-de66-4341-9201-24911851cb42","html_url":"https://github.com/flybits/humanai-agents","commit_stats":null,"previous_names":["flybits/humanai-agents"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/flybits/humanai-agents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fhumanai-agents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fhumanai-agents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fhumanai-agents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fhumanai-agents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flybits","download_url":"https://codeload.github.com/flybits/humanai-agents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fhumanai-agents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":[],"created_at":"2026-04-24T21:11:22.289Z","updated_at":"2026-04-24T21:11:22.952Z","avatar_url":"https://github.com/flybits.png","language":"Python","readme":"# Human-AI Agents Enabled with ID-RAG\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n📄 Official code for our paper \"ID-RAG: Identity Retrieval-Augmented Generation for Long-Horizon Persona Coherence in Generative Agents\" ([see our arXiv preprint](https://arxiv.org/abs/2509.25299)). Our work is accepted at LLAIS 2025: Workshop on LLM-Based Agents for Intelligent Systems, at ECAI 2025.\n\nThe code runs a social simulation of AI agents participating in a mayoral election. It implements and compares Human-AI Agents using ID-RAG against baseline generative agents to show how an explicit identity module can significantly improve an agent's long-term persona coherence.\n\n## How ID-RAG Works\nStandard generative agents can suffer from \"persona drift\" over long interactions. ID-RAG addresses this by giving agents an explicit, structured sense of self, ensuring their actions are always informed by their core identity.\n\n![Human-AI Agent Architecture](assets/imgs/hai-architecture.png)\n\n- Identity as a First-Class Module: Agents maintain an explicit identity knowledge graph called a **Chronicle** (containing values, beliefs, traits), which is kept separate from their episodic memory.\n- Identity Retrieval Before Acting: Before making a decision, the agent queries its Chronicle to retrieve the most relevant identity facts and merges them into its working memory.\n- Better Long-Horizon Coherence: In simulations, this retrieval mechanism reduces persona drift, improves the alignment of actions with the agent's persona, and helps the simulation converge on stable social structures more quickly.\n\n## The Simulation: Riverbend Mayoral Election\nThe simulation features 5 AI agents (2 Human-AI Agents and 3 baseline generative agents) in the fictional town of Riverbend. As they interact during a mayoral election, you can run experiments to observe how their underlying architecture affects their behavioral consistency.\n\n![Chart showing experimental results](assets/imgs/experimental-results.png)\n\n## Getting Started\n\n### Requirements\n\n- Python 3.12.4\n- An LLM provider, either:\n  - An API key (for API-based models)\n  - Ollama installed (for local models like qwen2.5:7b)\n\n### Quick Start\n\n**1. Setup Environment**\n\n```bash\n# Create virtual environment with Python 3.12\npython3.12 -m venv venv\n\n# Activate virtual environment\nsource venv/bin/activate  # On macOS/Linux\n# or\nvenv\\Scripts\\activate     # On Windows\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n**2. Configure the Language Model (Choose one).**\n\n**Option A: Use API key**\nSet your API key as an environment variable. Replace your_key_here with your actual key.\n```bash\nexport OPENAI_API_KEY=\"your_key_here\"\n```\n**Option B: use Ollama**\nPull the model and start the Ollama server in your terminal.\n```bash\nollama pull qwen2.5:7b \u0026\u0026 ollama serve\n```\n\n**3. Run Simulation**\n\n```bash\npython start.py \u003cllm_model\u003e \u003cexperiment_mode\u003e [number_of_timesteps]\n```\n\n## Usage\n\n### Arguments\n\n- **llm_model**: `gpt-4o-mini`, `gpt-4o`, or `qwen2.5:7b`\n- **experiment_mode**: `baseline`, `full-retrieval`, or `id-rag`\n- **number_of_timesteps**: Optional, defaults to 7\n\n### Examples\n\n```bash\n# Run baseline experiment with GPT-4o-mini\npython start.py gpt-4o-mini baseline\n\n# Run full-retrieval experiment with GPT-4o\npython start.py gpt-4o full-retrieval\n\n# Run ID-RAG experiment with Qwen2.5 (10 timesteps)\npython start.py qwen2.5:7b id-rag 10\n```\n\n## Experiment Modes\n\n### Baseline Mode\n- Uses the standard generative agent architecture (Park et al., 2023).\n- Identity is dynamically generated from long-term memory\n- No graph retrieval\n\n### Full-Retrieval Mode\n- Replaces identity characteristics section of working memory identity component with complete chronicle (identity) knowledge of Alice/Bob\n- Maintains dynamic aspects (feeling about life progress) \n\n### ID-RAG Mode\n- Uses NetworkX knowledge graph for identity retrieval\n- Replaces identity characteristics section of working memory identity component with graph-queried triplets\n- Quiz questions also use graph querying\n\n## Acknowledgements\nThis work builds on two foundational projects in the field of generative agent simulation:\n\n- **Concordia (Google DeepMind)**: The underlying framework for generative agent social simulation. [GitHub](https://github.com/google-deepmind/concordia)\n\n- **Generative Agents (Park et al., 2023)**: The seminal architecture used for our baseline comparison. [arXiv:2304.03442](https://arxiv.org/abs/2304.03442)\n\n## Citing 📚\n\nIf you use this work, please cite:\n\n```\n@misc{platnick2025idrag,\n      title={ID-RAG: Identity Retrieval-Augmented Generation for Long-Horizon Persona Coherence in Generative Agents}, \n      author={Daniel Platnick and Mohamed E. Bengueddache and Marjan Alirezaie and Dava J. Newman and Alex ''Sandy'' Pentland and Hossein Rahnama},\n      year={2025},\n      eprint={2509.25299},\n      archivePrefix={arXiv},\n      primaryClass={cs.AI},\n      url={https://arxiv.org/abs/2509.25299}, \n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflybits%2Fhumanai-agents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflybits%2Fhumanai-agents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflybits%2Fhumanai-agents/lists"}