Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add adapter-qdrant #2322

Merged
merged 23 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7da8f01
adapter-qdrant
invalid-email-address Jan 14, 2025
f7cd4e0
update
invalid-email-address Jan 14, 2025
34d36ef
chore: add cache && env conf
invalid-email-address Jan 15, 2025
53701d8
Merge branch 'develop' into feat-adapter-qdrant
invalid-email-address Jan 15, 2025
ee5aee0
chore: remove search limit
invalid-email-address Jan 16, 2025
3a7f800
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 16, 2025
2b65c93
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 16, 2025
d848426
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 17, 2025
2f6beb8
chore: delete cache
oxf71 Jan 17, 2025
72a1aff
Merge branch 'feat-adapter-qdrant' of github.com:b2network/eliza into…
oxf71 Jan 17, 2025
95accf9
chore: add env check
oxf71 Jan 17, 2025
654edf0
chore: create collection
oxf71 Jan 17, 2025
d4ee82c
chore: add env annotation
oxf71 Jan 17, 2025
a157d45
refactor: process the qdrant id
oxf71 Jan 17, 2025
48ce6f4
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 17, 2025
048931f
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 17, 2025
667dbc8
chore: modify cache key && add log
oxf71 Jan 20, 2025
4addabd
Merge branch 'develop' of github.com:elizaOS/eliza into feat-adapter-…
oxf71 Jan 20, 2025
844bc3b
chore: format
oxf71 Jan 20, 2025
f8bef0c
chore: rename var name
oxf71 Jan 20, 2025
7b8e61d
Merge branch 'develop' of github.com:elizaOS/eliza into feat-adapter-…
oxf71 Jan 22, 2025
08d6599
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 22, 2025
8b21401
Merge branch 'develop' into feat-adapter-qdrant
oxf71 Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,16 @@ DEEPGRAM_API_KEY=
VERIFIABLE_INFERENCE_ENABLED=false # Set to false to disable verifiable inference
VERIFIABLE_INFERENCE_PROVIDER=opacity # Options: opacity

# Qdrant
# URL of your Qdrant instance (e.g., https://your-instance.qdrant.tech)
QDRANT_URL=
# API key for authentication (optional for local instances)
QDRANT_KEY=
# Qdrant service port (default: 443 for cloud, typically 6333 for local)
QDRANT_PORT=443
# Vector size matching your embedding model (default: 1536 for OpenAI embeddings)
QDRANT_VECTOR_SIZE=1536

# Autonome Configuration
AUTONOME_JWT_TOKEN=
AUTONOME_RPC=https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps
Expand Down
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@elizaos/adapter-redis": "workspace:*",
"@elizaos/adapter-sqlite": "workspace:*",
"@elizaos/adapter-pglite": "workspace:*",
"@elizaos/adapter-qdrant": "workspace:*",
"@elizaos/client-auto": "workspace:*",
"@elizaos/client-direct": "workspace:*",
"@elizaos/client-discord": "workspace:*",
Expand Down
16 changes: 15 additions & 1 deletion agent/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PGLiteDatabaseAdapter } from "@elizaos/adapter-pglite";
import { PostgresDatabaseAdapter } from "@elizaos/adapter-postgres";
import { QdrantDatabaseAdapter } from "@elizaos/adapter-qdrant";
import { RedisClient } from "@elizaos/adapter-redis";
import { SqliteDatabaseAdapter } from "@elizaos/adapter-sqlite";
import { SupabaseDatabaseAdapter } from "@elizaos/adapter-supabase";
Expand Down Expand Up @@ -696,7 +697,20 @@ function initializeDatabase(dataDir: string) {
dataDir: process.env.PGLITE_DATA_DIR,
});
return db;
} else {
} else if (process.env.QDRANT_URL
&& process.env.QDRANT_KEY
&& process.env.QDRANT_PORT
&& process.env.QDRANT_VECTOR_SIZE
) {
elizaLogger.info("Initializing Qdrant adapter...");
const db = new QdrantDatabaseAdapter(
process.env.QDRANT_URL,
process.env.QDRANT_KEY,
Number(process.env.QDRANT_PORT),
Number(process.env.QDRANT_VECTOR_SIZE)
);
return db;
}else {
const filePath =
process.env.SQLITE_FILE ?? path.resolve(dataDir, "db.sqlite");
elizaLogger.info(`Initializing SQLite database at ${filePath}...`);
Expand Down
9 changes: 9 additions & 0 deletions packages/adapter-qdrant/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
!schema.sql
!seed.sql
!config.toml
3 changes: 3 additions & 0 deletions packages/adapter-qdrant/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import eslintGlobalConfig from "../../eslint.config.mjs";

export default [...eslintGlobalConfig];
30 changes: 30 additions & 0 deletions packages/adapter-qdrant/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@elizaos/adapter-qdrant",
"version": "0.1.0",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"@elizaos/source": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"dependencies": {
"@elizaos/core": "workspace:*",
"@qdrant/js-client-rest": "^1.12.0"
},
"devDependencies": {
"tsup": "8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint --fix --cache ."
}
}
Loading
Loading