# Alexandria

> Company context layer — a registry of everything a company knows (docs, code, notes, transcripts, skills), indexed for humans and AI agents. Hybrid search, an LLM-maintained wiki, REST API, and MCP.

## Docs

- [Product docs & quickstart](https://alexandria.page/docs)
- [Human quickstart](https://alexandria.page/docs#humans)
- [Agent / API quickstart](https://alexandria.page/docs#agents)
- [Integrations and indexing](https://alexandria.page/docs#integrations)
- [Projects, ACLs, and broad queries](https://alexandria.page/docs#scope)
- [Core concepts](https://alexandria.page/docs#concepts)
- [REST endpoint list](https://alexandria.page/docs#api)
- [Interactive system flow](https://alexandria.page/alexandria-system-flow.html)

## API

- Base URL: https://api.alexandria.page
- MCP endpoint: https://api.alexandria.page/mcp
- Health (no auth): GET https://api.alexandria.page/health

## Auth

- Create API keys in the web app at https://alexandria.page/app/settings
- Agents send `Authorization: Bearer alx_...` on `/v1/*` and `/mcp`
- Signed-in web clients use a Supabase JWT plus `x-workspace-id`
- Keys are scoped to a single workspace

## Endpoints

- `POST /v1/sources` — create source (`title`, `source_type`, `tier`; `content` or `url` required for managed/indexed)
- `GET /v1/sources` — list (`source_type`, `status`, `tags`, `q`)
- `GET /v1/sources/:id` — fetch content (`return_mode`, `query`)
- `PATCH /v1/sources/:id` — update metadata/content; content appends a document version
- `DELETE /v1/sources/:id` — soft-archive a source
- `GET /v1/sources/:id/processing` — poll asynchronous listener runs
- `GET /v1/sources/:id/documents` — list document versions
- `POST /v1/search` — hybrid search (`query`, optional `filters`, `top_k`, `return_mode`)
- `POST /v1/answer` — Ask planner + parallel retrievers + cited synthesis
- `/v1/projects` — project relevance scopes (admin mutations)
- `/v1/connectors` — connector config and secret provisioning (admin mutations)
- `GET /v1/wiki/index` — wiki index
- `GET /v1/wiki/pages?path=` — read wiki page (`return_mode`, `query`)
- `POST /v1/wiki/pages` — write wiki page (`path`, `content`)
- `GET /v1/wiki/log` — maintainer log (`tail`)
- `POST /v1/notes` — create managed note (`title`, `content`)
- `GET /v1/skills` — list skill sources
- `GET /v1/skills/:id` — fetch skill (`return_mode`, `query`)
- `ALL /mcp` — MCP Streamable HTTP

## MCP tools

- `search`, `search_context` — hybrid vector + keyword evidence search; optional `project_id`
- `search_code` — indexed code files/symbols; optional `path_glob`
- `recent_prs` — live recent open PRs from ACL-filtered GitHub repositories
- `fetch_source`, `add_source`, `write_note`
- `read_wiki_page`, `search_wiki`
- `list_skills`, `fetch_skill`

MCP exposes individual primitives, not the web Ask pipeline as one tool. Agents
should orchestrate several tools for broad questions.

## Integrations and indexing

- Creating a connector stores config and secret references; it does not deploy
  or start a worker.
- Slack uses Socket Mode, bot/app tokens, Events API message subscriptions, and
  a running persistent worker. It indexes new message activity by refetching
  the affected thread. There is no bulk Slack history backfill.
- GitHub is scheduled/poll sync, not webhook ingestion. Discover repositories
  in Settings, select them (select-all skips forks/archived by default), then
  deploy the worker and call connector `/sync` (or use the Settings sync
  action). `/sync` publishes one ordered Pub/Sub task per selected repository;
  each repo syncs in bounded batches with no 200-file completeness cap.
- Writes and connector sync are asynchronous. Evidence, embeddings, and wiki
  workers plus their Pub/Sub subscriptions must run before all derived results
  appear.

## Query scope and access

- Search spans every indexed, allowed source type unless filters or a project
  narrow it.
- Projects narrow relevance; they never grant permission.
- Source visibility and grants are intersected with project attachments before
  ranking. API-key agents without a user identity do not inherit user-specific
  restricted grants.
- `search`/`search_context` accept `project_id`; web Ask applies project
  scope to all selected retrievers. Standalone MCP `search_code`,
  `recent_prs`, and `fetch_source` do not currently accept a project ID,
  though they still enforce ACLs.
- For broad marketing/branding/video questions, search several related phrases,
  inspect the wiki, list/fetch skills, and follow citations with
  `fetch_source`.
- When the user says "store that knowledge," save durable, non-secret context
  with `write_note` or `add_source`.

## Return modes

Used on search and content fetch endpoints:

- `raw` — full text (default for search)
- `headroom` — compressed for context windows
- `llm_extract` — verbatim line ranges relevant to `query`

## Source tiers

- `managed` — Alexandria stores and indexes content
- `indexed` — content ingested for search
- `pointer` — metadata / URI only

## Plans

Managed at https://alexandria.page/app/settings/billing

- Free — $0 — 2 members, 50 sources, 200 searches/mo
- Team — $29/mo — 10 members, 1,000 sources, 5,000 searches/mo
- Pro — $99/mo — 25 members, 10,000 sources, 50,000 searches/mo

## Product surfaces

- Web app: https://alexandria.page (sign up → onboarding → /app)
- Landing: https://alexandria.page/
- Docs: https://alexandria.page/docs

## Contact

- Email: hello@alexandria.page
