About the Project DarAI
Inspiration
DarAI was inspired by a recurring problem in client-facing industries especially real estate.
Recommendation systems and agents tend to repeat the same mistakes.
Properties that consistently receive poor feedback are still suggested because most systems rely on static rules generic preference matching or surface level personalization.
In practice client dissatisfaction is rarely due to lack of options. It is caused by misalignment between lifestyle intent and recommendations.
This led us to a core question.
What if an AI agent could reflect on its own past decisions learn from failure and actively change how it recommends next time
DarAI was built to explore this idea using a self reflecting, self correcting AI voice agent.
What We Built
DarAI is a domain agnostic AI voice agent demonstrated using real estate that improves over time through feedback driven learning rather than model retraining.
The system is composed of multiple cooperating agents.
A Profiler enriches client intent using profile data and historical memory.
Two independent Generator agents produce shortlists using different reasoning styles one literal and one creative.
A Divergence Monitor quantifies disagreement between recommendations.
A Regulator selects the final shortlist by balancing logic memory and divergence.
A Critic analyzes client feedback to extract root causes when recommendations fail.
Each interaction updates a shared memory layer and a growing rule based playbook ensuring that learning benefits future clients not just the current one.
What We Learned
A key insight from building DarAI is that powerful learning does not require continuous model retraining.
Instead improvement can be achieved through structured memory, reflective feedback loops and adaptive prompt level rules.
We also learned that disagreement is valuable.
When two agents disagree strongly it often signals outdated assumptions or shifting client preferences.
High divergence indicates an opportunity for learning rather than an error.
Finally, we learned that explainability enables improvement.
When the system can explain why a recommendation failed it can change how it reasons next time.
How We Built It
The DarAI architecture was designed to be scalable observable and production ready while remaining simple enough to iterate quickly during experimentation.
At the core of the system is a Python based orchestration layer that coordinates all agents and manages both the request flow and the learning flow. Each client interaction is treated as a structured decision cycle rather than a single prompt response.
Core Intelligence Layer
All reasoning agents are powered by the Anthropic Claude API. Claude is used consistently across all six agents including the Profiler Generators Regulator and Critic to ensure coherent reasoning and shared context handling.
Each agent is prompted with a clearly defined role and objective. This separation allows the system to reason in parallel using different perspectives and later reconcile those perspectives through regulation rather than averaging outputs.
Memory and Learning Layer
For long term learning we use Mem0 as the semantic memory layer. Mem0 stores lessons learned from client feedback as searchable contextual memories. These memories are queried during future recommendations so that past successes and failures directly influence new decisions.
Analytics and learning signals are stored in ClickHouse using the clickhouse connect client. ClickHouse is used to log client ratings divergence scores complaint signals and rule confidence metrics at scale. This allows us to track how the system improves over time and validate whether learning is actually happening.
A playbook engine sits between memory and generation. When patterns cross a confidence threshold they are promoted into reusable rules that enrich future prompts automatically. This enables structured learning without hard coding logic or retraining models.
Voice and Interaction Layer
For voice output we use ElevenLabs to generate natural sounding property briefings and summaries. This allows DarAI to operate as a voice first agent suitable for real client conversations and call based workflows.
Client input feedback and results are handled through a web dashboard built using Streamlit. Streamlit enables rapid iteration and clear visualization of agent outputs shortlists and learning outcomes.
Interactive charts are built using Plotly to visualize metrics such as match rating improvement complaint rate reduction memory hit rate and divergence trends over time.
Data and Validation
Pandas is used extensively for data manipulation metric aggregation and learning analysis. This includes calculating confidence scores rolling averages and performance deltas between iterations.
Pydantic is used for data models and type validation across the system. This ensures structured inputs outputs and memory records and prevents malformed data from entering the learning loop.
Configuration and secrets management are handled using python dotenv to keep environment variables isolated and deployment friendly.
Resilience and Fallbacks
To ensure robustness during demos or API downtime the system includes fallback mechanisms. SQLite and in memory dictionaries are used as temporary stores when external services are unavailable. This allows the core learning logic to continue functioning even in degraded conditions.
Deployment and Scalability
The architecture supports horizontal scaling by allowing agents to run independently. Memory is namespaced per tenant enabling multi tenant isolation for different brokerages while still sharing base knowledge where appropriate.
This design allows DarAI to scale from a single demo instance to multiple concurrent deployments without architectural changes.
Self Improvement Mechanism
DarAI improves using three core pillars.
Feedback to Memory
Every client interaction produces feedback that becomes searchable memory.
If a location or property type consistently performs poorly for a profile segment it is remembered and avoided in future recommendations.
Divergence as a Learning Signal
Disagreement between agents is treated as information.
Low divergence confirms existing knowledge.
High divergence indicates that memory contradicts convention.
In high divergence cases the system prioritizes learned memory over static assumptions.
Playbook Growth
When confidence crosses a threshold insights are codified as rules.
Only high confidence rules are added to the playbook which enriches future prompts without hard coding logic.
Challenges We Faced
One major challenge was handling noisy feedback.
Not all client feedback is reliable so we implemented confidence weighting and pattern detection before storing learnings.
Another challenge was balancing creativity and precision.
Creative suggestions can delight clients but also increase failure risk requiring careful divergence regulation.
Finally we had to prevent the system from becoming rigid.
The playbook was designed as a living layer that guides reasoning rather than replacing it.
Why DarAI Matters
DarAI demonstrates that AI agents can move beyond static automation into adaptive reflective systems.
While real estate is used for demonstration the architecture applies to sales customer support advisory systems and any decision heavy feedback rich domain.
Our goal is simple.
Build AI agents that do not just respond they learn
Built With
- amazon-web-services
- claude
- clickhouse-connect
- elevenlabs
- mem0ai
- pandas
- plotly
- pydantic
- python
- streamlit
Log in or sign up for Devpost to join the conversation.