Lightweight SDK for Federal Acquisition Regulations (FAR) search - no LangChain required
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file far_search-1.0.0.tar.gz.
File metadata
- Download URL: far_search-1.0.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff5c3da0fa462831f069f9118fa6630ff53fa03c7c00836bd7ebc0305f9ea2b1
|
|
| MD5 |
8d7099f64c080b827ef65244483459d9
|
|
| BLAKE2b-256 |
987b0cc71bc32580450b17ceace01ce2100f56f5ccc102d1dc885753651a074a
|
File details
Details for the file far_search-1.0.0-py3-none-any.whl.
File metadata
- Download URL: far_search-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc574aafd9ebe2edf2cc048b29c92cb75fb68d03809c450c03c9b8f79a2c038
|
|
| MD5 |
ed4d8b3542fb86f3bca0260de64bd456
|
|
| BLAKE2b-256 |
958e664bac77b4aa8ce19584823892d1ac290d8c557f2dbdf7d0032c6a5c1a70
|