How sarthakroy-1/astrion works
ASTRION is a tenant-scoped logistics support and operations agent. A user asks a question; the agent investigates workspace records and authority-ranked documents, while deterministic policy code computes decisions. The response exposes evidence and uncertainty. Proposed state changes stop for explicit confirmation before execution. The graph preserves the documented identity/workspace, document, operations, audit, and durable-storage capabilities. Some subsystem links rely on README documentation or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: records.py Structured records · __init__.py PostgreSQL / SQLite · orchestrator.py Agent orchestrator · registry.py Agent tool registry
Components 20
User experience
- Next.js workspace UI
app/frontend/src/app/workspace/page.tsx - Conversation workflow
app/frontend/src/hooks/useConversation.ts
Identity and tenancy
- FastAPI routes
app/backend/api/routes.py - Authentication flows
app/backend/api/auth_routes.py - OAuth and verification
app/backend/api/identity_routes.py - Workspace membership
app/backend/api/workspace_routes.py - Tenant scope
app/backend/tenancy.py
Agent investigation
- Agent orchestrator
app/backend/agent/orchestrator.py - Agent tool registry
app/backend/tools/registry.py - Authority-ranked retrieval
app/backend/retrieval/search.py - Structured records
app/backend/services/records.py - Document ingestion
app/backend/services/document_ingestion.py
Decisions and actions
- Deterministic policy engine
app/backend/policies/service_credit.py - Confirmation-gated actions
app/backend/services/actions.py - Operations intelligence
app/backend/operations/service.py
Data and operations
- PostgreSQL / SQLite
app/backend/db/__init__.py - Document object storage
app/backend/storage/store.py - Hash-chained audit
app/backend/services/audit.py
Other components
- Support user
- LLM provider
Connections 26
- Support user → Next.js workspace UI: asks or confirms
- Next.js workspace UI → FastAPI routes: sends requests
- FastAPI routes → Authentication flows: routes identity requests
- FastAPI routes → Agent orchestrator: builds agent context
- Authentication flows → PostgreSQL / SQLite: stores credentials
- OAuth and verification → Authentication flows: completes sign-in
app/backend/api/identity_routes.py - Workspace membership → Tenant scope: enforces workspace scope
app/backend/api/workspace_routes.py - Workspace membership → PostgreSQL / SQLite: reads memberships
app/backend/api/workspace_routes.py - Agent orchestrator → Agent tool registry: dispatches tools
app/backend/agent/orchestrator.py - Agent orchestrator → LLM provider: uses planner provider
- Agent tool registry → Authority-ranked retrieval: retrieves evidence
- Agent tool registry → Structured records: looks up records
- Agent tool registry → Deterministic policy engine: evaluates rules
- Agent orchestrator → Confirmation-gated actions: prepares actions
app/backend/agent/orchestrator.py - Agent orchestrator → Structured records: reads workspace data
app/backend/agent/orchestrator.py - Deterministic policy engine → Authority-ranked retrieval: gathers policy evidence
app/backend/policies/service_credit.py - Deterministic policy engine → Structured records: reads order facts
app/backend/policies/service_credit.py - Structured records → Tenant scope: scopes queries
app/backend/services/records.py - Document ingestion → PostgreSQL / SQLite: indexes documents
app/backend/services/document_ingestion.py - Document ingestion → Document object storage: stores originals
- Authority-ranked retrieval → PostgreSQL / SQLite: searches indexed sources
- Structured records → PostgreSQL / SQLite: reads tenant records
- Confirmation-gated actions → PostgreSQL / SQLite: persists action state
- Operations intelligence → Structured records: analyzes records
app/backend/operations/service.py - Authentication flows → Hash-chained audit: records security events
app/backend/api/auth_routes.py - Confirmation-gated actions → Hash-chained audit: records action events