| Crates.io | polymathy |
| lib.rs | polymathy |
| version | 0.1.0 |
| created_at | 2025-08-21 16:37:00.870363+00 |
| updated_at | 2025-08-21 16:37:00.870363+00 |
| description | A high-performance web service that processes search queries, retrieves relevant content, and performs semantic chunking and embedding operations |
| homepage | |
| repository | https://github.com/sokratis-xyz/polymathy |
| max_upload_size | |
| id | 1805037 |
| size | 137,991 |
A high-performance web service that processes search queries, retrieves relevant content, and performs semantic chunking and embedding operations. This is similar to what perplexity.ai does.
Polymathy is a web service that enhances traditional search by providing intelligent content processing capabilities:
This approach allows users to get direct answers from search results rather than just links to potentially relevant pages.
You can install the polymathy binary directly using cargo:
cargo install --path .
This will install the polymathy binary in your ~/.cargo/bin directory. You can then run it from anywhere.
To use Polymathy as a library in your Rust project, add this to your Cargo.toml:
[dependencies]
polymathy = { git = "https://github.com/sokratis-xyz/polymathy" }
git clone https://github.com/sokratis-xyz/polymathy.git
cd polymathy
.env file in the project root with the following variables:SEARXNG_URL=http://your-searxng-instance/search
PROCESSOR_URL=http://your-processor-service/process
SERVER_HOST=127.0.0.1
SERVER_PORT=8080
# Using cargo run (recommended)
cargo run --release
# Or explicitly specify the binary name
cargo run --bin polymathy --release
The service will be available at http://localhost:8080 (or your configured host/port).
GET /v1/search?q={query}
Parameters:
q (required): The search query stringResponse: Returns a map of processed content chunks with their associated URLs and text.
Example response:
{
"0": ["https://example.com/article1", "This is a relevant chunk from the first article"],
"1": ["https://example.com/article2", "This is another relevant chunk from a different article"]
}
The API documentation is available at the following endpoints:
/swagger/redoc/rapidoc/scalar/openapi.jsonRust documentation can be generated and viewed using:
cargo doc --open
The service is built using:
Polymathy is organized into the following modules:
search: Handles search query processingcontent: Manages content processing and chunkingembedding: Handles embedding generationindex: Manages vector indexingapi: Defines API endpoints and server implementationThe service uses the following configuration options for content processing:
Contributions are welcome! Please feel free to submit pull requests.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)