How vijdaancoding/rescue-ai works
1. Repository shape
- This is a small Python application packaged under core/.
- The top-level architecture is centered around a runtime entrypoint, an agent layer, a room/server layer, and a few supporting modules for tasks, text-to-speech, and shared data models.
2. Primary entrypoint
- core/run.py is the likely bootstrap path for the application.
- It is the place where the program probably wires together the agent, room server, task logic, and any runtime configuration.
3. Agent layer
- core/agent.py appears to define the general agent behavior and orchestration logic.
- core/rescue_agent.py likely specializes that generic agent into the domain-specific “rescue” behavior, acting as the main business logic implementation.
4. Room/server subsystem
- core/room/server.py suggests a server component that manages a “room” abstraction, likely coordinating participants, events, or sessions.
- This is a separate boundary from the agent logic, implying the agent interacts with a session/state host rather than owning all state directly.
5. Task subsystem
- core/tasks.py is likely where discrete work units, job definitions, or workflow steps are defined.
- In the architecture diagram, this should sit between the agent decision-making layer and the operational actions it triggers.
6. Speech/output integration
- core/tts.py provides text-to-speech functionality.
- This is an external capability boundary: the core logic likely emits text, and this module converts or routes it into spoken/audio output.
7. Shared data contracts
- core/utils/models.py is the shared model layer.
- It likely defines the data structures used across the agent, tasks, and room/server modules, helping keep boundaries clean and reducing coupling.
8. Dependency direction
- The expected flow is: run.py boots the system, the agent/rescue agent drives behavior, tasks structure work, the room server manages interaction/state, and TTS handles audio output.
- Shared models are used horizontally by multiple subsystems rather than being owned by any one of them.
9. Package and runtime boundary
- pyproject.toml and uv.lock indicate a modern Python package managed with uv.
- That means the repo is self-contained at the application/package level rather than split into separate services.
10. What to show in an architecture diagram
- Show one central application runtime with four meaningful boundaries: agent logic, room/server coordination, task/workflow execution, and TTS/output.
- Place utils/models.py as the contract layer connecting them.
- Avoid drawing a browser/frontend or database unless you confirm them elsewhere; the visible repo structure does not imply either one.
11. Overall interpretation
- This repository looks like a domain-specific agent system for “rescue” scenarios, with interaction/session management and voice output support.
- The architecture is modular and service-like inside a single Python codebase, with clear separation between orchestration, state/session handling, and external output integration.
Main entry points: run.py Runtime · rescue_agent.py Rescue agent · models.py Models · server.py Room server
Components 7
Core package
Application code under core/
- Runtime · Application entrypoint and wiring
core/run.py - Agent · General agent behavior and coordination
core/agent.py - Rescue agent · Domain-specific rescue behavior
core/rescue_agent.py - Room server · Room/session coordination and state hosting
core/room/server.py - Tasks · Discrete work units and action steps
core/tasks.py - TTS · Text-to-speech integration boundary
core/tts.py - Models · Shared data structures used across modules
core/utils/models.py
Connections 14
- Runtime → Agent: starts · Bootstraps the agent layer
- Runtime → Rescue agent: selects · Wires the domain-specific implementation
- Runtime → Room server: hosts · Starts or connects the room/session boundary
- Runtime → Tasks: loads · Makes task logic available at startup
- Runtime → TTS: configures · Sets up speech output integration
- Runtime → Models: shares · Uses common data contracts during wiring
- Agent → Rescue agent: specializes · General behavior is extended by rescue logic
- Rescue agent → Tasks: drives · Plans or triggers task execution
- Rescue agent → Room server: coordinates · Acts within the room/session host
- Rescue agent → TTS: speaks · Emits text for spoken output
- Rescue agent → Models: uses · Consumes shared domain models
- Tasks → Models: schemas · Task definitions rely on shared contracts
- Room server → Models: validates · Uses shared models for session data
- TTS → Models: formats · May use shared models for output payloads