AI-human Alignment and Cooperation: enabling AI to learn cooperation through long-term alignment
English | 简体中文
AICO, AI-human Alignment and Cooperation, is an open research framework exploring long-term human-AI collaboration.
It is not only concerned with preserving more historical information. It explores how AI can gradually learn to understand a person, understand relationships between people, and respond, collaborate, and act more appropriately across different goals and situations.
For AICO, long-term interaction is not a passive accumulation of chat history. It is an evolving alignment process: AI needs to know whom it is working with, whom it is currently interacting with, what the current topic and relationship mean, and how a multi-turn conversation should be organized and advanced. In PERSONAL mode, AICO serves the user and their relationship world. In EXPERT mode, it aligns with an expert's professional logic, service style, and decision process, while assisting interaction with clients.
Many AI systems can already preserve preferences, extract facts, retrieve history, or inject long-term memory into context. AICO aims to take a further step: make this long-term information participate in dialogue judgment and organization, so AI knows not only what happened before, but also how to collaborate with people appropriately now.
| Direction | The Capability AICO Pursues |
|---|---|
01 From factual continuity to behavioral continuity |
AI does not only remember that someone “prefers concise messages.” It also considers relationship stage, the current topic, and implicit interaction goals to choose a more appropriate tone, pace, and boundary. |
02 From single-turn relevance to multi-turn strategy |
When a conversation has stages and a purpose, AI does not simply answer sentence by sentence. It can organize the dialogue through a strategy tree: understand context, build common ground, enter the core request, and adjust its path from real feedback. |
03 From static personalization to negotiated co-evolution |
Alignment is not AI privately defining a person. In PERSONAL mode, it is calibrated through AI, the user, partner feedback, and interaction outcomes. In EXPERT mode, the expert has final authority over their logic tree, profile, and rules. |
04 From fragmented memories to a relationship world model |
Interactions with different people form an owner-private relationship graph. When talking with A, the system reads the local, relationally connected context around A rather than indiscriminately injecting all history. |
flowchart LR
I[Long-term interaction] --> A[Alignment model<br/>people, relationships, topics, goals, expert logic]
A --> S[Strategy organization<br/>relationship subgraph, topic graph, strategy tree, RAG]
S --> C[Cooperative interaction<br/>reply, recommendation, or professional decision]
C --> F[Feedback and confirmation<br/>user, interaction partner, expert, system]
F --> A
This loop turns long-term interaction into evidence for the next act of cooperation. AICO focuses on four questions: who is being aligned with, who is the current interaction partner, what the topic and multi-turn purpose are, and how AI can cooperate and evolve while respecting clear authority and confirmation sources.
| Mode | Aligned Subject | Interaction Partner | Purpose |
|---|---|---|---|
| PERSONAL | The user themself | Self, friends, family, colleagues, other people | Learn the user's identity, preferences, memories, relationship network, and everyday dialogue strategies. |
| EXPERT | The expert | Client | Align with the expert's logic, style, knowledge structure, decision tree, and service workflow. |
In EXPERT mode, the client is modeled as a service context for better expert-side replies. The client is not the long-term aligned subject.
| Layer | Meaning | Used for |
|---|---|---|
| Personal Profile | Stable and dynamic profile of the user | Long-term personal alignment |
| Expert Profile | Expert style, school, knowledge structure, preferences | Expert logic alignment |
| Client Service Profile | Client case context, current need, risk signals, communication style | Supporting expert replies |
| Relationship Graph | Owner-private graph of people, relationships, events, constraints, and strategies | Reading relationship context before replying |
| Topic Graph | Dynamic semantic graph of extracted topics | Reuse, extend, or create strategy trees |
| Strategy Tree | Macro-level dialogue logic tree | Organizing multi-turn conversation flow |
| RAG Memory | Professional knowledge, personal memory, relationship memory, historical strategy | Compact retrieval for generation |
| Confirmation Records | AI/user/expert/system confirmation source | Traceability, revision, and governance |
AICO's relationship graph is not a global social graph. Each user owns a private graph built from their own conversations.
For user me, AICO may build:
me
├── A
│ ├── A's parent
│ └── A's colleague
├── B
│ └── B's mother
└── C
When me chats with A, AICO retrieves a local subgraph instead of the whole graph.
| Retrieved Context | Why |
|---|---|
Direct me-A edge |
Relationship state, events, trust, tension |
Person nodes for me and A |
Profiles, preferences, constraints |
| Topic-relevant one-hop or two-hop relations | Background people and indirect context |
| Strategy implications | How relationship should affect the reply |
AICO's rule of thumb:
The LLM proposes what should be updated; the system controls evidence, merging, deduplication, confidence, permissions, and persistence.
| Feature | Status |
|---|---|
| PERSONAL and EXPERT mode separation | Implemented in algorithm layer and frontend routes |
| Dynamic topic extraction | LLM-compatible extractor with local fallback |
| Topic graph reuse / merge / create | Implemented |
| Strategy tree runtime | First executable version |
| Owner-private relationship graph | First version implemented |
| Multi-source RAG | Supports knowledge, personal memory, relationship memory, strategy memory, expert profile, and client service profile |
| Expert/client frontend structure | April frontend retained and extended |
| Java alignment endpoints | Extended with AICO state, client service profile, and relationship edge details |
| Technical report | Coming soon |
aico/
├── api/ # Shared protocols and AICOOrchestrator entry point
├── alignment/ # Topic extraction, topic graph, vector similarity, iteration jobs
├── perception/ # Profiles, personal state, and relationship graph
├── decision/ # Thought tree and strategy tree runtime
├── knowledge/ # Retrieval and multi-source RAG
├── evaluation/ # Response and feedback evaluation
├── generation/ # Prompt and response generation
├── backend/ # Spring Boot backend extended from April
├── frontend/ # Vue frontend extended from April
├── algorithm/ # Preserved and reconstructed algorithm assets
├── storage/ # JSON state store for current development
└── tests/ # Python tests
AICO uses a dedicated conda environment named aico.
conda env create -f environment.yml
conda activate aico
python -m pip install -e .Run Python tests:
python -m unittest discover -s testsExpected current result:
Ran 7 tests
OK
from aico import AICOOrchestrator
from aico.api.schemas import AICOTurnInput, ClientMessage, InteractionMode
orchestrator = AICOOrchestrator()
output = orchestrator.process_client_message(
AICOTurnInput(
interaction_mode=InteractionMode.PERSONAL,
counterpart_id="A",
message=ClientMessage(
client_id="user_1",
conversation_id="conv_personal_A",
text="I want to contact A again, but I do not want to pressure him.",
metadata={"relationship_type": "friend"},
),
)
)
print(output.response.text)
print(output.response.metadata["active_relationship_subgraph"])cd frontend
npm install
npm run dev| Route | Meaning |
|---|---|
/personal |
PERSONAL entry |
/personal-workbench |
Personal alignment workbench |
/expert |
EXPERT entry |
/expert-chat |
Expert workspace |
/parent-chat |
Lightweight client chat |
/decision-tree |
Strategy tree editor |
/aico-alignment |
Alignment state viewer |
cd backend
mvn spring-boot:run| Method | Endpoint | Description |
|---|---|---|
| POST | /api/aico/alignment/turns |
Record a turn and update alignment state |
| GET | /api/aico/alignment/users/{userId}/state |
Get aligned subject state |
| GET | /api/aico/alignment/relationships |
Get PERSONAL relationship state |
| POST | /api/aico/alignment/feedback |
Record user or expert feedback |
Topic and relationship extraction are designed around an OpenAI-compatible chat endpoint. If no endpoint is configured, AICO uses conservative local fallback logic so tests and offline development remain runnable.
$env:AICO_LLM_ENDPOINT="http://localhost:11434/v1/chat/completions"
$env:AICO_LLM_API_KEY="local-dev-key"
$env:AICO_LLM_MODEL="your-local-model"Embedding currently uses a deterministic local implementation for development and tests. It can later be replaced with a production embedding provider.
| Area | Next Step |
|---|---|
| Technical report | Release AICO technical report and architecture diagrams |
| Relationship graph UI | Click an edge to inspect people, events, evidence, constraints, and confirmation status |
| Strategy tree executor | Tighten node transition control and bind traces to real conversations |
| Expert confirmation workflow | Complete candidate topic/tree/node confirmation in expert workbench |
| Persistent backend | Move JSON state toward database or event-stream persistence |
| LLM extraction | Replace local fallback with stronger structured extraction and production embeddings |
AICO is released under the GNU Affero General Public License v3.0 (AGPL-3.0).
If AICO contributes to your work, please cite the project using the entry below. Until the technical report is published, this software citation is the recommended reference.
@software{aico_lab_aico_2026,
author = {Pengcheng Zhou},
title = {AI-human Alignment and Cooperation: enabling AI to learn cooperation through long-term alignment},
year = {2026},
url = {https://github.com/PKQZPC/AICO},
note = {Open-source research framework}
}