FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Adding Vector Search to a Zero-Dependency Python Package
How-ToProgramming Languages

Adding Vector Search to a Zero-Dependency Python Package

via Dev.to PythonXiaona (小娜)1mo ago

Last week I built agent-memory , a lightweight memory system for AI agents. It started with TF-IDF keyword search — simple, fast, zero dependencies. But keyword search has limits. "What did I learn about deployment?" won't match "Figured out how to ship to production." I needed semantic search. The obvious answer: sentence-transformers + numpy. But that's 2GB of PyTorch for a 672-line package. The whole point was zero dependencies. Here's how I added vector search without adding a single dependency. The Architecture User configures embedding API (optional) ↓ add() → text → HTTP POST /v1/embeddings → vector ↓ vectors.jsonl (id + float array) ↓ search() → query → embed → cosine similarity → ranked results The key insight: embeddings are an API call, not a local computation. OpenAI, Cohere, Jina, and dozens of providers all expose the same /v1/embeddings endpoint. Use urllib (stdlib) to call it. Pure Python Cosine Similarity No numpy needed: def cosine_similarity ( a , b ): dot = sum ( x

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
27 views

Related Articles

How-To

What I learned about X-HEEP by Benchmarking

Medium Programming • 6h ago

No more Chinese Polestar 3s as production shifts entirely to the US
How-To

No more Chinese Polestar 3s as production shifts entirely to the US

Ars Technica • 7h ago

How-To

The most important 40 mcq with its answers How to use Android visual studio to make a mobile app

Medium Programming • 7h ago

What is Agent Script? How to Build Agents with It in Agentforce
How-To

What is Agent Script? How to Build Agents with It in Agentforce

Medium Programming • 7h ago

I Coded 3 Famous Trading Strategies in Pine Script and Backtested All of Them. None Passed.
How-To

I Coded 3 Famous Trading Strategies in Pine Script and Backtested All of Them. None Passed.

Medium Programming • 8h ago

Discover More Articles