-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(new-adapter): mongo-db adaptor (#1427)
* mongo-db adaptor Added an adaptor which connects to mongo db atlas. Allowing you to store agent data in the cloud. If you have the appropriate tier you can also take advantage of their vector search functionaility. * mongo fix * mongoDB Fixes for Merge * Fixing Mongo for new version * k * update `.env.example` and agent/src/index * test mgdb package * Update pnpm-lock.yaml * Update index.ts * update mongodb implementation and tests * remove unnecessary check ins --------- Co-authored-by: Sayo <[email protected]>
- Loading branch information
Showing
18 changed files
with
2,340 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ packages/plugin-buttplug/intiface-engine | |
node-compile-cache | ||
|
||
.idea | ||
.vscode | ||
.zed | ||
.DS_Store | ||
|
||
dist/ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
* | ||
|
||
!dist/** | ||
!package.json | ||
!readme.md | ||
!tsup.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import eslintGlobalConfig from "../../eslint.config.mjs"; | ||
|
||
export default [...eslintGlobalConfig]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "@elizaos/adapter-mongodb", | ||
"version": "0.0.1", | ||
"description": "MongoDB adapter for ElizaOS", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@elizaos/core": "workspace:*", | ||
"mongodb": "^6.3.0", | ||
"uuid": "^9.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.11", | ||
"@types/node": "^20.11.5", | ||
"@types/uuid": "^9.0.7", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.1.1", | ||
"tsup": "^8.0.1", | ||
"typescript": "^5.3.3" | ||
}, | ||
"scripts": { | ||
"build": "tsup", | ||
"dev": "tsup --format esm --dts --watch", | ||
"lint": "eslint --fix --cache .", | ||
"test": "cd src/__tests__ && ./run_tests.sh", | ||
"test:watch": "jest --watch" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"testMatch": ["<rootDir>/src/__tests__/**/*.test.ts"] | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/adapter-mongodb/src/__tests__/docker-compose.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json | ||
version: '3.8' | ||
services: | ||
mongodb-test: | ||
image: mongo:latest | ||
environment: | ||
MONGO_INITDB_ROOT_USERNAME: mongodb | ||
MONGO_INITDB_ROOT_PASSWORD: mongodb | ||
MONGO_INITDB_DATABASE: eliza_test | ||
ports: | ||
- "27018:27017" | ||
healthcheck: | ||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 |
Oops, something went wrong.