How kaiwenchen6627/corporate-event-agent works
This is a bounded corporate-event collaboration agent: customer messages create or update an opportunity, trigger requirement interpretation and gap analysis, retrieve knowledge, and lead either to a follow-up question or proposed solution options. Humans approve commercial terms and options, review staged replies before sending, and review knowledge before it can inform retrieval. Reflection and historical-thread import feed candidate principles or cases back into the knowledge base. The main workflow and store are evidenced in sampled source; several additional endpoint behaviors are documented in the README, so their wiring is shown only where supported.
Main entry points: agent.py Agent service · knowledge_store.py Knowledge store · importer.py Historical thread import · opportunities_browser.html Opportunity browser
Components 21
Opportunity workflow
- Agent service
agent.py - Opportunity state
agent.py - Message interpretation
agent.py - Gap analysis and plan
agent.py - Evidence retrieval
agent.py - Solution options
agent.py - Staged reply
agent.py
Knowledge lifecycle
- Knowledge store
infrastructure/knowledge_store.py - Historical thread import
ingestion/importer.py - Historical cases
infrastructure/knowledge_store.py - Capabilities
infrastructure/knowledge_store.py - Principles
infrastructure/knowledge_store.py
Human review
- Knowledge review
agent.py - Option and terms approval
agent.py - Human reflection
agent.py - Reply send approval
agent.py
User interfaces
- Opportunity browser
review/opportunities_browser.html - Knowledge browser
review/knowledge_browser.html
Other components
- Customer
- LLM provider
- Human reviewer
Connections 28
- Customer → Agent service: sends message
- Agent service → Opportunity state: updates state
- Agent service → Message interpretation: interprets message
- Message interpretation → LLM provider: interprets context
- Agent service → Gap analysis and plan: checks gaps
- Agent service → Evidence retrieval: requests evidence
- Evidence retrieval → Knowledge store: searches records
- Knowledge store → Historical cases: reads approved cases
- Knowledge store → Capabilities: reads approved capabilities
- Knowledge store → Principles: filters approved principles
- Agent service → Solution options: builds options
- Agent service → LLM provider: drafts customer text
- Agent service → Staged reply: stages draft
- Customer → Historical thread import: provides thread
- Historical thread import → LLM provider: extracts timeline and case
- Historical thread import → Knowledge store: adds pending case
- Human reviewer → Knowledge review: reviews records
- Knowledge browser → Knowledge review: submits review actions
- Knowledge review → Knowledge store: approves or rejects
- Human reviewer → Option and terms approval: approves option or terms
- Option and terms approval → Opportunity state: records approval
- Human reviewer → Human reflection: submits edits
- Human reflection → LLM provider: summarizes lessons
- Human reflection → Opportunity state: appends lessons
- Human reflection → Knowledge store: adds pending principles
- Human reviewer → Reply send approval: approves send
- Reply send approval → Opportunity state: promotes reply
- Opportunity browser → Agent service: browses opportunities