MongoDb class.
Usage
Install thepymongo and openai packages:
mongodb_for_agent.py
Run MongoDB
Install docker desktop and run MongoDB on port 27017 using:Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | Optional[str] | - | The ID of the database instance. UUID by default. |
db_client | Optional[MongoClient] | - | The MongoDB client to use. |
db_name | Optional[str] | - | The name of the database to use. |
db_url | Optional[str] | - | The database URL to connect to. |
session_collection | Optional[str] | - | Name of the collection to store sessions. |
memory_collection | Optional[str] | - | Name of the collection to store memories. |
metrics_collection | Optional[str] | - | Name of the collection to store metrics. |
eval_collection | Optional[str] | - | Name of the collection to store evaluation runs. |
knowledge_collection | Optional[str] | - | Name of the collection to store knowledge documents. |
culture_collection | Optional[str] | - | Name of the collection to store cultural knowledge. |
traces_collection | Optional[str] | - | Name of the collection to store traces. |
spans_collection | Optional[str] | - | Name of the collection to store spans. |
schedules_collection | Optional[str] | - | Name of the collection to store cron schedules. |
schedule_runs_collection | Optional[str] | - | Name of the collection to store schedule run history. |
learnings_collection | Optional[str] | - | Name of the collection to store learnings. |