Inspiration
I started from a notebook idea: an agent structured like human cognition — a Brain, an Internal State, an External State — pretrained generically, then "raised" by the one person it serves, like a dog raised by its owner. Every interaction is a state-change event written into one unified memory, and that history is the personalization. Companio is that idea made real, built on Gemini and Google's Agent Development Kit.
What it does
Companio remembers you specifically — every fact carries a Beta(alpha, beta) belief, so confidence and how much evidence backs it are both tracked. It learns when to ask vs. just answer from real feedback, and never silently overwrites a contradiction — it stages surprising updates for confirmation instead. It also ingests messy real data (a WhatsApp export) into searchable, anonymized domain knowledge, and runs with zero setup on a built-in stub or real Gemini.
It ships as a real app, not just a CLI — a browser-based chat interface (FastAPI + a single-page UI) wraps the same Companion core, with a live sidebar showing the profile it's building, the 3-source memory feed, and adaptation metrics as I talk to it, backed by real Gemini reasoning when a key is configured.
How I built it
Five sub-agents run the loop: Clarifier (ask-vs-act), Retriever (semantic + episodic + domain knowledge), Guide (the response), Feedback, and Consolidator (belief updates). Everything writes through one shared, source-tagged SQLite store so a profile survives across sessions. Generation routes through a real google.adk.Agent + Runner, with a raw-SDK fallback. The Bayesian math (Beta, KL divergence) is built from scratch on the stdlib, no scipy.
Challenges I ran into
I hit a live 404 from a deprecated Gemini model name, and had to verify ADK's real API by installing the actual package rather than trusting training data. Anonymizing chat data took two passes — the first caught sender names, the second caught first-name mentions buried in message text. I also caught a subtle bug where corrections were leaking a false negative reward into the ask-vs-act learning loop, and later a second one where an over-aggressive entropy check was silently discarding profile facts the app had already retrieved.
Accomplishments that I'm proud of
A confidence model where contradiction-handling scales automatically with how much evidence a belief already has, no tuning constant needed. An ask-vs-act policy that provably learns — verified by a test showing its score changes after one piece of feedback. A real messy dataset run through real anonymization and safety filtering, not a synthetic stand-in. A working web app on top of the core loop, verified end-to-end with real Gemini responses, not just the stub. 28 passing tests across the full loop.
What I learned
That "the agent adapts" is only a real claim once it's a number you can point to — clarifying_rate trending down and profile_influence_rate trending up across sessions, not just a description of intent. And that verifying an SDK against the actual installed package, not memory, is worth it every time an API can move underneath you.
What's next for Companio
Deploying to Cloud Run with Firestore as the memory backend — persistence is already isolated behind one interface so this touches a single file. Closing the biggest gap: right now growth needs an explicit signal (a rating, a correction); ordinary conversation isn't mined for facts yet. Tuning the surprise threshold and Clarifier's decision boundaries against real interaction logs instead of hand-picked defaults.
Built With
- bayesian-inference
- google-adk
- google-gemini
- google-genai
- natural-language-processing
- policy-gradient
- pytest
- python
- reinforcement-learning
- semantic-search
- sqlite

Log in or sign up for Devpost to join the conversation.