Search — bRRAIn Docs
Search interfaces, semantic search, full-text search, filtering, and advanced query syntax.
Search
Portal search is graph-based. Every query traverses entities, relationships, and content simultaneously, producing results that consider the full bRRAIn ontology rather than just raw keywords.
Three search interfaces
1. Quick search (web UI)
The global search bar (press / anywhere in the Portal) handles 90% of daily queries. It accepts natural-language questions, filenames, or keywords.
Example queries:
Q1 financial reports mentioning hedgecontracts signed by Alice in 2026deposition files linked to case cx-12345
2. Advanced search
Advanced search exposes filter panels for classification, date range, document type, owner, and workspace. Combine filters with free-text queries for precise results.
3. API / SDK
results, err := portal.Search(ctx, &portal.SearchInput{
Query: "hedge strategy 2026",
Workspaces: []string{"finance"},
Classification: portal.Internal,
Types: []string{"pdf", "docx"},
Limit: 20,
})
Returns: documents, confidence scores, snippets, and the related graph nodes.
Semantic vs full-text
Every query runs both semantic and full-text search in parallel; results are merged and re-ranked by the Handler.
- Semantic search uses domain-specific embeddings (via the active Handler adapter). "Recent client concerns" returns the right documents even if neither word appears verbatim.
- Full-text search handles exact phrases, identifiers, and technical tokens. Good for
CVE-2024-1234,case#cx-12345, orAlice Chen. - Graph context boosts documents whose linked entities (people, projects, decisions) match the query intent.
Filtering
| Filter | Example values |
| --- | --- |
| classification | public, internal, confidential, restricted |
| type | pdf, docx, image, video |
| owner | user email or UUID |
| workspace | workspace slug |
| created_after, created_before | ISO 8601 date |
| tags | custom tags applied at upload |
Filters are combinable. Omitted filters match everything.
Advanced query syntax
The search bar supports field operators:
owner:alice@lawfirm.io classification:confidential "hedge strategy"
Boolean operators:
tax AND compliance AND (deadline:2026-04)
Proximity and fuzzy:
"transfer pricing"~5 # terms within 5 words of each other
securitiz~2 # up to 2 edit distance
Relationship operators (graph-aware):
linked_to:decision:dec_234 # documents connected to a decision
about:project:project-alpha # documents about a project
Ranking
Results are ranked by a weighted combination of:
- Semantic similarity (Handler-produced embedding distance)
- Full-text BM25 score
- Graph centrality (how connected the document is to the query's entities)
- Recency decay (configurable per workspace)
- Access frequency (personalized)
Workspace admins can tune these weights under Settings → Search at any time.
Performance
| Workspace size | Typical latency (p95) | | --- | --- | | ≤ 1,000 docs | < 200 ms | | ≤ 10,000 docs | < 800 ms | | ≤ 100,000 docs | < 3 s | | 1M+ docs | < 8 s (with cold cache) |
Search indices are maintained incrementally; new uploads are searchable within 30 seconds.