create an adl search service #361
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Title
Create ADL Search Service using Vector Similarity (Qdrant)
PR Description
Fixes #346
Summary
This PR introduces an initial implementation of the ADL Search Service, an API server that accepts a conversation and returns related ADLs (Action Definition Languages) using semantic similarity.
The service stores ADLs in a vector database and performs similarity search against incoming conversations to identify the most relevant ADLs. The implementation focuses on correctness, clarity, and extensibility rather than production hardening, making it suitable as a foundation for future improvements.
Motivation
As ADLs grow in number and complexity, keyword-based matching becomes insufficient for reliably identifying relevant actions from natural language conversations.
The goal of this service is to:
Enable semantic search over ADLs
Improve discoverability of relevant ADLs from free-form conversations
Provide a simple, well-structured reference implementation that can be iterated on
This aligns with the long-term objective of building intelligent, context-aware systems on top of ADLs.
Design Overview
The service is implemented as a lightweight API server with the following responsibilities:
Vector Storage
ADLs are embedded into vectors using a sentence-level embedding model
Vectors and metadata are stored in Qdrant
Semantic Search
Incoming conversations are embedded at query time
The vector database is queried using similarity search
Top-K related ADLs are returned with metadata
API Layer
Simple HTTP endpoints for indexing and querying
Clear separation between embedding logic, storage, and API handling
The design intentionally avoids premature optimization and keeps all components replaceable (e.g., embedding model, vector store).
What’s Included
API Server
Health check endpoint
ADL indexing endpoint
ADL query endpoint (semantic similarity)
Vector Backend
Qdrant used as the vector database
Collection initialization handled automatically
Embedding
Sentence-level embeddings generated at runtime
Embeddings stored alongside ADL metadata
Sample Data
Example ADLs provided for local testing and validation
Documentation
README with setup and usage instructions
Clear guidance for local development
Tech Stack
Language: Python
API Framework: FastAPI
Vector Database: Qdrant
Embeddings: Sentence Transformers
(Design is portable and can be adapted to Kotlin/Ktor in future iterations.)
Testing
The following manual verification was performed locally:
Indexed sample ADLs into Qdrant
Queried the service with natural language conversations
Verified that semantically related ADLs are returned
Confirmed API responsiveness via health endpoint
Local build and run:
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
python -m pip install -r adl-search-service/requirements.txt
uvicorn adl-search-service.app.main:app --reload
Backward Compatibility
No existing functionality is modified
The service is additive and self-contained
No breaking changes introduced
Future Work
Persistent storage and retention policies
Authentication and authorization
Ranking improvements and filtering
Batch indexing and async ingestion
Kotlin/Ktor implementation
Checklist
Clear problem statement and motivation
Minimal, focused implementation
No production assumptions
Documented setup and usage
Respectful, inclusive communication