minor constants refactoring
This commit is contained in:
26
packages/shared/src/config/constants.js
Normal file
26
packages/shared/src/config/constants.js
Normal file
@@ -0,0 +1,26 @@
|
||||
//A store for tunables and constants used across the codebase, to avoid magic numbers and hardcoded values
|
||||
|
||||
const QDRANT = {
|
||||
DEFAULT_URL: 'http://localhost:6333',
|
||||
VECTOR_SIZE: 768, // Must match the output dimension of the embedding model (e.g. nomic-embed-text)
|
||||
DISTANCE_METRIC: 'Cosine', // Best for normalized embeddings like text vectors
|
||||
DEFAULT_LIMIT: 10, //Default top-=k for vector searches
|
||||
};
|
||||
|
||||
const COLLECTIONS = {
|
||||
EPISODES: 'episodes',
|
||||
ENTITIES: 'entities',
|
||||
SUMMARIES: 'summaries'
|
||||
};
|
||||
|
||||
const EPISODIC = {
|
||||
DEFAULT_RECENT_LIMIT: 10, // Default number of recent episodes to retrieve
|
||||
DEFAULT_PAGE_SIZE: 20, // Default number of episodes per page for pagination
|
||||
DEFAULT_SEARCH_LIMIT: 10, // Default number of search results to return
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
QDRANT,
|
||||
COLLECTIONS,
|
||||
EPISODIC
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
const {getEnv} = require('./config/env');
|
||||
const {QDRANT, COLLECTIONS, EPISODIC } = require('./config/constants');
|
||||
|
||||
module.exports = {getEnv};
|
||||
module.exports = {getEnv, QDRANT, COLLECTIONS, EPISODIC};
|
||||
Reference in New Issue
Block a user