Autonomous agent fleet for ambient computing. Agents run 24/7 in Docker, store knowledge in a Memgraph graph database, consolidate memories overnight, and surface a morning briefing for you to review on your phone.
- Python 3.12+
- Docker & Docker Compose
- A Google AI Studio API key (Gemini)
# 1. Clone the repo
git clone https://github.com/javiergarci/ambient.git
cd ambient
# 2. Create your .env file
cp .env.example .env
# Edit .env and add your GOOGLE_API_KEY
# 3. Run bootstrap (starts Memgraph, creates venv, installs deps, seeds schema)
./scripts/bootstrap.sh
# 4. Activate the virtual environment
source .venv/bin/activateTalk to the orchestrator agent directly:
python -m ambient.mainJavier> Remember that my supplier is Acme Logistics in San Jose, Costa Rica
Javier> What do I know about Acme?
Javier> Draft an email to the supplier about the delayed shipment
Javier> quit
python -m ambient.main "What pending approvals do I have?"docker compose upThis starts:
| Service | Port | Description |
|---|---|---|
| Memgraph | 7687 | Knowledge graph (Bolt protocol) |
| Memgraph Lab | 3000 | Visual graph explorer |
| Briefing API | 8000 | Morning briefing + approvals REST API |
| Orchestrator | — | Root agent (interactive) |
The API serves morning briefings and approval workflows for the PWA:
# Get today's briefing
curl http://localhost:8000/briefing
# List pending approvals
curl http://localhost:8000/approvals
# Approve an item
curl -X POST http://localhost:8000/approvals/<id> \
-H "Content-Type: application/json" \
-d '{"action": "approve", "note": "Looks good"}'
# View knowledge graph stats
curl http://localhost:8000/graph/stats
# Manually trigger overnight consolidation
curl -X POST http://localhost:8000/consolidation/trigger
# Manually trigger morning briefing generation
curl -X POST http://localhost:8000/briefing/triggerOpen http://localhost:3000 (Memgraph Lab) and run:
-- See everything
MATCH (n) RETURN n;
-- See all entities and their relationships
MATCH (a:Entity)-[r]->(b:Entity) RETURN a, r, b;
-- See recent episodes
MATCH (e:Episode) RETURN e ORDER BY e.timestamp DESC LIMIT 20;
-- See pending approvals
MATCH (a:Approval {status: 'pending'}) RETURN a;The system uses Google ADK (Python) with Gemini. Agents are organized in a hierarchy:
- Orchestrator — routes tasks to specialists
- Inbox Agent — email drafting and triage
- Ops Agent — operational tasks and monitoring
Every agent has access to knowledge graph tools (remember, recall, store_entity, relate_entities) and approval tools (request_approval).
All knowledge is stored as a graph:
- Entities — open-schema nodes (people, companies, products, concepts)
- Episodes — timestamped observations, decisions, and events
- Relationships — typed edges between entities (dynamic, any type)
Overnight (default 3 AM), the consolidation engine:
- Runs PageRank on entities to score importance
- Runs community detection to cluster related entities
- Applies memory decay — old, unimportant episodes fade out
- Prunes episodes below the decay threshold
At wake time (default 7 AM), the system generates a briefing with:
- Pending approval items from the agent fleet
- Highlights from recent high-importance episodes
- Graph statistics
- Create
src/ambient/agents/your_agent.pyusing thecreate_agent()factory - Add it as a sub-agent in
orchestrator.py - Optionally add agent-specific tools in
src/ambient/tools/ - Add a Docker service in
docker-compose.ymlif it needs its own container
| Variable | Default | Description |
|---|---|---|
GOOGLE_API_KEY |
— | Gemini API key (required) |
MEMGRAPH_HOST |
localhost |
Memgraph hostname |
MEMGRAPH_PORT |
7687 |
Memgraph Bolt port |
BRIEFING_API_PORT |
8000 |
Briefing API port |
AGENT_OWNER_NAME |
Javier |
Your name (used in prompts) |
SLEEP_CYCLE_HOUR |
3 |
Hour to run consolidation (24h) |
WAKE_CYCLE_HOUR |
7 |
Hour to generate briefing (24h) |
TIMEZONE |
America/Costa_Rica |
Timezone for scheduling |
# Requires Memgraph running
source .venv/bin/activate
pytest