How eimg/primer works
Primer turns registered organizational sources into permission-aware, ranked evidence and cited answers. The principal workflow is source registration and synchronization, canonical record processing and indexing, bounded query planning, hybrid retrieval with authorization and ranking, context construction, then answer generation and citation validation; traces and evaluations make decisions inspectable. CLI and React clients share the HTTP application and service layer. The graph preserves documented inspection, identity, connector, and evaluation capabilities; some unsampled implementation links rely on README statements rather than inspected source.
Main entry points: services.ts Application services · registry.ts Connector registry · app.ts HTTP API · App.tsx React application
Components 22
User interfaces
- React application
web/src/App.tsx - Browser API client
web/src/api.ts - CLI
src/cli.ts
Application services
- HTTP API
src/app.ts - Identity and access
src/auth.ts - Application services
src/services.ts - Runtime configuration
src/config.ts - Web assets
src/webAssets.ts
Source ingestion
- Connector registry
src/connectors/registry.ts - Connector providers
src/connectors/contracts.ts - Slack export
src/connectors/slack-export.ts - Markdown processing
src/markdown.ts - Canonical processor
src/connectors/canonical-processor.ts - Acme fixture
src/fixture.ts
Retrieval and evidence
- SQLite index
src/database.ts - Query planning
src/planner.ts - Embedding provider
src/embeddings.ts - Candidate ranking
src/ranking.ts - Authorized context
src/context.ts
Answers and evaluation
- Answer generation
src/answers.ts - Evaluation and traces
src/services.ts
Other components
- User
Connections 26
- User → React application: uses
README.md - React application → Browser API client: requests
web/src/App.tsx - Browser API client → HTTP API: calls
README.md - User → CLI: runs
README.md - CLI → Application services: invokes
src/cli.ts - HTTP API → Application services: dispatches
src/app.ts - HTTP API → Identity and access: authorizes
src/app.ts - HTTP API → Web assets: serves
src/app.ts - Application services → Runtime configuration: uses
src/services.ts - Application services → Connector registry: synchronizes through
src/services.ts - Connector registry → Connector providers: dispatches
src/connectors/registry.ts - Connector registry → Slack export: loads provider
src/connectors/default.ts - Connector registry → Markdown processing: loads processor
src/connectors/default.ts - Connector registry → Canonical processor: processes items
src/connectors/default.ts - Application services → SQLite index: persists and queries
src/services.ts - Application services → Acme fixture: validates and loads
src/services.ts - Application services → Query planning: plans queries
src/services.ts - Application services → Embedding provider: embeds content
src/services.ts - Application services → Candidate ranking: ranks results
src/services.ts - Application services → Authorized context: builds context
src/services.ts - Application services → Answer generation: generates answers
src/services.ts - Application services → Evaluation and traces: runs evaluations
README.md - Application services → SQLite index: saves traces
README.md - Answer generation → Runtime configuration: configures provider
src/answers.ts - Embedding provider → Runtime configuration: configures provider
src/embeddings.ts - React application → HTTP API: inspects retrieval
README.md