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(context): introduce memory layer #95

Merged
merged 10 commits into from
Jul 31, 2024
Prev Previous commit
Next Next commit
chore(context/memory): add logger to memory saving
  • Loading branch information
idiotWu committed Jul 30, 2024
commit 1c0b38d06727bf8bd9e112966493212322fc38f4
3 changes: 2 additions & 1 deletion npiai/context/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def save(self, info: str):
Args:
info: Information to save
"""
self._memory.add(
m = self._memory.add(
data=info,
run_id=self.id,
metadata={"raw": info},
Expand All @@ -121,6 +121,7 @@ async def save(self, info: str):
)
# clear cache
self._query_cache = {}
logger.debug(f"Saved memory: {m}")

async def ask(
self,
Expand Down