FAR Search - Core SDK
Lightweight SDK for semantic search over Federal Acquisition Regulations (FAR).
No LangChain dependency - just requests. Perfect for:
- Simple scripts and notebooks
- Serverless functions (minimal cold start)
- Projects that don't use LangChain
- Lightweight microservices
Installation
pip install far-search
Size comparison:
far-search: ~10KB + requests (~1MB total)far-search-tool: ~15KB + LangChain (~150MB total)
Quick Start
from far_search_core import FARSearchClient
# Auto-registers on first use - no API key needed!
client = FARSearchClient()
# Search
results = client.search("cybersecurity requirements", top_k=5)
for clause in results:
print(f"{clause.id}: {clause.title}")
print(f" Score: {clause.similarity_score:.1%}")
print(f" URL: {clause.url}")
Convenience Function
from far_search_core import search_far
# One-liner search
results = search_far("small business set aside requirements")
FARClause Object
Each result is a FARClause dataclass:
@dataclass
class FARClause:
id: str # e.g., "52.204-2"
title: str # e.g., "Security Requirements"
text: str # Full clause text
source: str # e.g., "FAR Part 52"
url: str # acquisition.gov URL
similarity_score: float # 0.0 - 1.0
Get Formatted Text (for LLMs)
client = FARSearchClient()
# Get pre-formatted text for LLM context
text = client.search_text("contract termination procedures")
print(text)
Get Specific Clause
client = FARSearchClient()
clause = client.get_clause("52.203-1")
if clause:
print(clause.text)
Configuration
# With explicit API key
client = FARSearchClient(api_key="far_live_...")
# With RapidAPI key (for higher limits)
client = FARSearchClient(rapidapi_key="your-rapidapi-key")
# Environment variables
# export FAR_API_KEY=far_live_...
# export FAR_QUIET=1 # Suppress usage warnings
Pricing
| Plan | Price | Queries/Month |
|---|---|---|
| Free | $0 | 500 |
| Pro | $29/mo | 5,000 |
| Ultra | $199/mo | 150,000 |
Auto-registers on first use. Upgrade at RapidAPI.
Error Handling
from far_search_core import FARSearchClient, FARAPIError, FARRateLimitError
client = FARSearchClient()
try:
results = client.search("my query")
except FARRateLimitError:
print("Rate limit exceeded - upgrade your plan")
except FARAPIError as e:
print(f"API error: {e}")
Related Packages
| Package | Use Case |
|---|---|
| far-search (this) | Lightweight, no dependencies |
| far-search-tool | LangChain tool integration |
| far-search-crewai | CrewAI multi-agent tool |
| far-search-autogpt | AutoGPT plugin |
| far-oracle | MCP Server for Claude Desktop |
License
MIT License - see LICENSE for details.
Metadata
Release files for far-search 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| far_search-1.0.0.tar.gz | 7.5 kB | Without provenance | Details for far_search-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| far_search-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for far_search-1.0.0-py3-none-any.whl |
Total release size: 15.7 kB
Release files / far_search-1.0.0.tar.gz
| Download URL | far_search-1.0.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff5c3da0fa462831f069f9118fa6630ff53fa03c7c00836bd7ebc0305f9ea2b1
|
|
BLAKE2b-256 checksum How to use checksums |
987b0cc71bc32580450b17ceace01ce2100f56f5ccc102d1dc885753651a074a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / far_search-1.0.0-py3-none-any.whl
| Download URL | far_search-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fc574aafd9ebe2edf2cc048b29c92cb75fb68d03809c450c03c9b8f79a2c038
|
|
BLAKE2b-256 checksum How to use checksums |
958e664bac77b4aa8ce19584823892d1ac290d8c557f2dbdf7d0032c6a5c1a70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for far-search 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.